Message ID | 20241118214650.3667577-1-kaleshsingh@google.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 121C6D60CE7 for <linux-mm@archiver.kernel.org>; Mon, 18 Nov 2024 21:46:58 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6F3246B0083; Mon, 18 Nov 2024 16:46:58 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 6A2896B0085; Mon, 18 Nov 2024 16:46:58 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 56A676B0088; Mon, 18 Nov 2024 16:46:58 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 3988A6B0083 for <linux-mm@kvack.org>; Mon, 18 Nov 2024 16:46:58 -0500 (EST) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id C09E0AD401 for <linux-mm@kvack.org>; Mon, 18 Nov 2024 21:46:57 +0000 (UTC) X-FDA: 82800549804.30.27DAC84 Received: from mail-yw1-f201.google.com (mail-yw1-f201.google.com [209.85.128.201]) by imf20.hostedemail.com (Postfix) with ESMTP id 3BA091C000C for <linux-mm@kvack.org>; Mon, 18 Nov 2024 21:45:54 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=LXaJp09M; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf20.hostedemail.com: domain of 3zrU7ZwsKCGkRHSLZOZPUNONVVNSL.JVTSPUbe-TTRcHJR.VYN@flex--kaleshsingh.bounces.google.com designates 209.85.128.201 as permitted sender) smtp.mailfrom=3zrU7ZwsKCGkRHSLZOZPUNONVVNSL.JVTSPUbe-TTRcHJR.VYN@flex--kaleshsingh.bounces.google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1731966350; a=rsa-sha256; cv=none; b=tNC9DIyUo0LLGcdYUITV1OgtuyHyyxVrdup+i9oPIAJNQY32fvxpG8jfKqa687oBCq6KLf fvJUQLdI3QR/caCcltdHBcuZzFLqXzPnrdBjFQKa19uuzQImcJSRaRhtmXo6ILjlWW/NRc 4tR6hQRe57gP55ZKRA852qKtjLzng/U= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=LXaJp09M; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf20.hostedemail.com: domain of 3zrU7ZwsKCGkRHSLZOZPUNONVVNSL.JVTSPUbe-TTRcHJR.VYN@flex--kaleshsingh.bounces.google.com designates 209.85.128.201 as permitted sender) smtp.mailfrom=3zrU7ZwsKCGkRHSLZOZPUNONVVNSL.JVTSPUbe-TTRcHJR.VYN@flex--kaleshsingh.bounces.google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1731966350; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding:in-reply-to: references:dkim-signature; bh=TvOCdV4s2TNa5ISzo3BdsjjuMEaKM722wwhwoXrHkjQ=; b=g672NIdge6aFKOjRDZ9eD6ZtY+w+Vu3WntoMCP6eTu9JnMJigrVZwys4tK1Cf5PlZclQ9D /Lbi0fs5YjYz/0tXxnlKd9h8nRVQY2jjVk0nK9LR9c5wcgk3TVCTTYeY3X1+j7ovcsuUuD 3WP+8bci8D0i2GM7Isj42R8DceqnpgU= Received: by mail-yw1-f201.google.com with SMTP id 00721157ae682-6ee813065afso33079207b3.0 for <linux-mm@kvack.org>; Mon, 18 Nov 2024 13:46:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1731966415; x=1732571215; darn=kvack.org; h=cc:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=TvOCdV4s2TNa5ISzo3BdsjjuMEaKM722wwhwoXrHkjQ=; b=LXaJp09M/MHjgRTh0fW95CiGegBBNCM0kwPQJpKkJFDp9hxoMrxvWOqj39Z4u5HWYU 82H074/ygCfy/UaUMUaC4pRYEWHc/wevtu+TdWxNaDzZTdmSlY7v75fzVyQsbPVIClBY cXlr3qGgdiqAZJ+ktJsxPG3BLGwrWyBP7bmKXxvwqgpVinfZDbP6+L1owX23ITGFzUBm XIX4XgfUA9/aDu7A2w34f0oExwq4Vq4SbWCGg9gtMk7ML+Tzgw8/BdtBQNaL4TRZzWTy Gc/tohEjvAG8PAzBnslKkTwuDH/AL9lWVEzpmK0WGKBIZi9BO0M0mlw3DpaxypOuKnVp pobw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731966415; x=1732571215; h=cc:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=TvOCdV4s2TNa5ISzo3BdsjjuMEaKM722wwhwoXrHkjQ=; b=vI+We7hVg8Voq5rWOeDbrEOFsn7VKsC67yHtlfOTAbhry3E3p8w7aQDL6VtrMFqsoq 5xI5bahcq7zuU7vHRId/QbEl1MtQfanXoO1BUEIrPhaNoY51/TAxgInsHZrei52mI2KA Os4UEqEaPGvIfSVNlgFpsnhS4VUBVDiGBhXxTQj0Pj0cr6eIl+PnaWK0GGhI3GoLXkU2 DF6gQXxJVtdoV6MujwmZw+7ytjPeoreQHleErJ5UdwVVDVcvPjbbmGnb8jEseIVw+yD8 lQ9VgWfIUmL/k6RZBiGDk+vYlI6fppkP9fHoW3u5Tuxv5xW7CR4wK3TaRQX5qfykthwk wAFg== X-Forwarded-Encrypted: i=1; AJvYcCWSnzqTLZf8zkzIEdbmn9AOXqpr9QsZdDRgGBlaI7X4fhWG35qyEaaFeYdznER5zNYbHh0XcgDS6w==@kvack.org X-Gm-Message-State: AOJu0YzKJijlQHnSxYEcHJe96c02s9pHRvCcgaCYJH6bPoXSgc87b76h V2C0ZsOhDRwhKgdAROCUGs9B/2ygXkrOQs6qjIYuT4Qk+UO7eGil9KMTo783XG536XHTPFPmYCD lRUl2+D8+skxR4mcmukK7Ew== X-Google-Smtp-Source: AGHT+IEuDWbTMXz+ht1hQLEvCDYEG9ppylXQkzguGm3T6mmWzkk/64xr+RI0ZQ0tDGlSNMX+q8PbO7BDoMupncte1g== X-Received: from kalesh.mtv.corp.google.com ([2a00:79e0:2e3f:8:ed74:6cb:48a0:1f9b]) (user=kaleshsingh job=sendgmr) by 2002:a05:690c:8bc1:b0:6ee:5091:4254 with SMTP id 00721157ae682-6ee55cf1b83mr921467b3.6.1731966414927; Mon, 18 Nov 2024 13:46:54 -0800 (PST) Date: Mon, 18 Nov 2024 13:46:48 -0800 Mime-Version: 1.0 X-Mailer: git-send-email 2.47.0.338.g60cca15819-goog Message-ID: <20241118214650.3667577-1-kaleshsingh@google.com> Subject: [PATCH v2] mm: Respect mmap hint address when aligning for THP From: Kalesh Singh <kaleshsingh@google.com> Cc: kernel-team@android.com, android-mm@google.com, Kalesh Singh <kaleshsingh@google.com>, Andrew Morton <akpm@linux-foundation.org>, Vlastimil Babka <vbabka@suse.cz>, Yang Shi <yang@os.amperecomputing.com>, Rik van Riel <riel@surriel.com>, Ryan Roberts <ryan.roberts@arm.com>, Suren Baghdasaryan <surenb@google.com>, Minchan Kim <minchan@kernel.org>, Hans Boehm <hboehm@google.com>, Lokesh Gidra <lokeshgidra@google.com>, stable@vger.kernel.org, "Liam R. Howlett" <Liam.Howlett@oracle.com>, Lorenzo Stoakes <lorenzo.stoakes@oracle.com>, Jann Horn <jannh@google.com>, Yang Shi <shy828301@gmail.com>, linux-mm@kvack.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Rspam-User: X-Rspamd-Queue-Id: 3BA091C000C X-Rspamd-Server: rspam01 X-Stat-Signature: iz73oxanw5r5jj1b4td68hh8qqghoi3c X-HE-Tag: 1731966354-64873 X-HE-Meta: U2FsdGVkX18Ruh3yg3tKto9pEiHr4fWDV33W9l4Dc/DARIgm2MFmOOYDEKOp3qj181UWqyBker1tudTuxCR7dpPwOWyV5+E2O8b5g3crBVyJBoheHhr01WhbNzfQ4fNs14G8P8i9xkwLvKJnG/dbwEciW4im6SuJCHhFlgro4WljBKcT3l9PrDETt4kx38stCLsY3OAlMspNWonhsn7n/HQdP0ccW6HtBG+PDye0Y8dME+3H2jYlss2Aoj1on2BnOiPg1+YQxNOGFeIxJASk90LHZxM5lX85gKq/zCDS7psKk5qZEQSuM3p7KnbIpPfD7pnMxSR+t73Y3kABC7PQdxZqkIULN1RTLS+ud4YoDEi+C2dmBnezGwHoWODSJlWAn51+e7NC+aumUkmoT4SjrZEa1TxvQ9t37qUkv6qeXZY+ZdQQoUgyJd7uJKuKpRyoHbhWV9I11tCDpHBnknr4kwyd0SqxnrlSzrcfvJueyBSGX9qziT0uo/ZpTWb9+P03c2YVTNGJkqArnbr6z+8PtJSV7FgivE4Yj24dZQ5idOiWN78dLfa5/7fXmI3RgdJ7q5jsB+4b0geduAH5H2NFiSKLc2sVq9idpMVDQdUaBWi5AJy8EaYlDCtpz4gUCie7nV1qw4DpIq3dTBnKPtCboXB54xboyOOhsOjQtgrKg7eAXsZBLwrDvpelFyF9TQzoi0KfJhQpJs3mUQL39ErNUQ11/WDY4oc7UfNXaVnLcMitxoYu4rKnPiLz7wIzFD3WJ4FbWX8JGUDheseTm6bXoHTxMyH5e7MVWbB/BkgLnBczhLmL7+cqd+kM3m3POr6NCnYTIzoZ+dgKupdY21Xa8vKQoJ5EGi1mu4dt2ijSWMj+A4QFvDl7eoAvEIUzNzAt8iIhrvBo5QT7PhDYE2YPVfMYZVWDzvPPPmOkBGbBGj7uXBtxLvEZC3x90RFWvbKzdc4wgiaBV1jxSlLEiO8 o5YJh5lF FZfHyB4ZveAFtOD+47lUVlrbcl/AFABvapYdfVWisuHwgiLcLtmBL+uZfav/dasEtVOTNar1WX1XVdPTJQEdTuuXAf9zA9FCtkYyG9oWFWzn4DZX5jt4uPGo1ZH3BuHdrzZEloMJe4u5yI1Qgioaj/pJjRdipc/OwXCiwp7/DzmwNEhz8EyrCIECRIKTOauQcBIXE7mtA2yCfjDs5NlOBVfLRUgC40XPxfAciEBPb3dokulnExfwbwx+JEZHgQodt1IoVykkANUklICqPqf+CbTI/d3bnofUsuAzVGKkV02ayq8aeRs54nO9yv22Hf+uAjII5q+qlC+d32hx467ySm2If6mnUBQO9C0T1P9rKruShgyV376gEdzY0q/gpldUBHd40D574Q+eUHVmas+JAsgbiZaMoqrAmuTOV0fH+mzQCFAjJOVBjjdzFx7/VY3814dqEayvuU3wawnsFV7Of22HoDCgZVQp0RjeDe8ogWIy4XhHUdx30VTN0GU/F8mC3N5HnZbtQoqTXORgDkoDwdkpqoArQCsvdoYIhmBcqMWfW8R85E1eRBseOBBAhzmX7+FgXWzhCrkYV1ygiGumYVJ10wbYAk32m+OJg7KiUhx3bUJozITcZA7hOahgDI4iG0J7lzT+jiToRLNHmOulvIDf1JBEvh+7pPVzeb4xqnmEA4mEPRZAY8HQsn6PUWTF68ZQpaD3bO3qImClLCIGWKDsNq6dKp/d+ogq3NYe8kqhtKKjSKwlXSjB/rQKPPN/nqVGNHgivmmz33l88awCvQi44/yHLLnSYEJQxcXdIAXAjGvUenXJiB++x/Pl9g/TFT1nANAaoFee1JHXs/K5TlCdWPpjwvCrDfvJO0TwZE6fTxQGi/C6RbG+f1+jHSth4DD7iUr/zK04gV6I= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> List-Subscribe: <mailto:majordomo@kvack.org> List-Unsubscribe: <mailto:majordomo@kvack.org> |
Series |
[v2] mm: Respect mmap hint address when aligning for THP
|
expand
|
diff --git a/mm/mmap.c b/mm/mmap.c index 79d541f1502b..2f01f1a8e304 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -901,6 +901,7 @@ __get_unmapped_area(struct file *file, unsigned long addr, unsigned long len, if (get_area) { addr = get_area(file, addr, len, pgoff, flags); } else if (IS_ENABLED(CONFIG_TRANSPARENT_HUGEPAGE) + && !addr /* no hint */ && IS_ALIGNED(len, PMD_SIZE)) { /* Ensures that larger anonymous mappings are THP aligned. */ addr = thp_get_unmapped_area_vmflags(file, addr, len,