Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp1324085rdb; Sat, 3 Feb 2024 01:32:03 -0800 (PST) X-Google-Smtp-Source: AGHT+IFEWAFJWS2rmsAudvj2JXDMQHVw3O4E7Ay0f+SVufGneyWHLQbvdu8j5X45zQQ4WIK5xyIJ X-Received: by 2002:aa7:d6d7:0:b0:55f:5187:b18d with SMTP id x23-20020aa7d6d7000000b0055f5187b18dmr1298147edr.20.1706952723412; Sat, 03 Feb 2024 01:32:03 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706952723; cv=pass; d=google.com; s=arc-20160816; b=0bOqCu4SQEPvg9BDvYzdKpbvBvNi1I9nbTRPd2OZ0lAnrQHxwy1NMN6I/8TzFlcoRF 77MflB/RX4SskLD8YYAmHLnC77SWo4k8veaBsIOvz6kl+/j4fhMdd0ATW7HpJfOvs4GH ik3VY72vPh+tZC1ALKacKE97w4Kat8WvIDBC8aMWWsJe8fzbGiz8HMzBHikmuFpvquxc IAfki8JwRg1HWJ7fGKwrSbsairK3NeczSgqQJ2abws4mMcTllWhW8a8rZuYGu+jXdBEX vZCP3iWVP0ewuQqQT5FRM9W87lea32CKnVbvz/MiLCtaim/TQaKTEFv6rNjT7dN1n3TY CYag== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=g2CgHBOzTJbFlAKTQXg1WL2KK9oVV89TerzEy4yduHs=; fh=/VflMC+8cX9Zfv7jWDkY9dIeHVGNzAeSjZhpRyFQuvE=; b=spKWwjLeNFXOcxvIMwqkW5M7pzhA10kklCz+mgcMIN9DMCsu6kRn/WPMQFlGqjahLM C+6n1IbMjcOuM6lFsnhHCLEIuBRsIlsP9n5ltnAGLTgGGu+5m+KquAxWIKjECUzBRzcm HrXgNpNWereVMAFb4mdnMi/0pTgEeMvtlaQ4fIIDUWaC/bSlTBoenCP8DN3SLYsrs4Uc yIRcSAt4z8J8nxc+Ix4dDhw5ZFJxgrbUYGESv2dVhmNYV1TNS7raHfmzj8rfl9HyND9n pfEU7l+9wkf9/1cu31XV5kP6xhHQS1YW7J/OvJkx6WWYGizbl9YZoQuR6vkMJ/beP0VB Dz0g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=leemhuis.info); spf=pass (google.com: domain of linux-kernel+bounces-51007-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-51007-linux.lists.archive=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=1; AJvYcCXiCoHkMdu0/Ves18SU+H3JXnQPodVdaNydNEtlPMya9Uc3o1zrDmKo43l00GggCiSuzdVttcpFRh9gBBmb0FkavrsN4BOOGpsyvu+a7g== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id m28-20020a50d7dc000000b0055ec0611324si1608343edj.108.2024.02.03.01.32.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 03 Feb 2024 01:32:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-51007-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=leemhuis.info); spf=pass (google.com: domain of linux-kernel+bounces-51007-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-51007-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 3884B1F2CB48 for ; Sat, 3 Feb 2024 09:24:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 64B615D734; Sat, 3 Feb 2024 09:24:36 +0000 (UTC) Received: from wp530.webpack.hosteurope.de (wp530.webpack.hosteurope.de [80.237.130.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EA5415D728; Sat, 3 Feb 2024 09:24:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=80.237.130.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706952275; cv=none; b=JhlmUpFtKmM8lIBnEu0WjiO8Uj+jKY52xD0gCs/SZv0ZBhi9n9tOl32m74wvr47Dk+os2TUHDxCjaqsIa5eGs6P/ELOCzWJzvP0xKFchxVvXQhDRzSbOhWO3pKNGNQLzLUBWEDBcvvREqJzjTWud2Az+IKpIBAbU82uTGMPOou4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706952275; c=relaxed/simple; bh=uH4mJz4z0y+IyQgvblzylCvq8UBc92LMdZ5tmXgKbLM=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=BwF2zMg09Uc6LZdSZO7fxEeDFwPx2YzMAM1avnnBYmiUBsNqNYP0FHgYqcd2A/RsGuTZFUmn++a03HexJH70qJiwRXd5EjgGCDwqpJ8NeFOQ904r5fvQDzQRGcBtDTSv1c7qmmJ+rtvNAwNeDR5yhAWFzLjCyV0lT9elpFq6vUs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=leemhuis.info; spf=pass smtp.mailfrom=leemhuis.info; arc=none smtp.client-ip=80.237.130.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=leemhuis.info Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=leemhuis.info Received: from [2a02:8108:8980:2478:8cde:aa2c:f324:937e]; authenticated by wp530.webpack.hosteurope.de running ExIM with esmtpsa (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) id 1rWCG4-0001ZP-Tq; Sat, 03 Feb 2024 10:24:21 +0100 Message-ID: Date: Sat, 3 Feb 2024 10:24:20 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] mm: huge_memory: don't force huge page alignment on 32 bit Content-Language: en-US, de-DE To: Yang Shi , jirislaby@kernel.org, surenb@google.com, riel@surriel.com, willy@infradead.org, cl@linux.com, akpm@linux-foundation.org, Linux kernel regressions list Cc: yang@os.amperecomputing.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20240118133504.2910955-1-shy828301@gmail.com> From: Thorsten Leemhuis In-Reply-To: <20240118133504.2910955-1-shy828301@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-bounce-key: webpack.hosteurope.de;regressions@leemhuis.info;1706952274;0485d69a; X-HE-SMSGID: 1rWCG4-0001ZP-Tq On 18.01.24 14:35, Yang Shi wrote: > From: Yang Shi > > The commit efa7df3e3bb5 ("mm: align larger anonymous mappings on THP > boundaries") caused two issues [1] [2] reported on 32 bit system or compat > userspace. > > It doesn't make too much sense to force huge page alignment on 32 bit > system due to the constrained virtual address space. > > [1] https://lore.kernel.org/linux-mm/CAHbLzkqa1SCBA10yjWTtA2mKCsoK5+M1BthSDL8ROvUq2XxZMw@mail.gmail.com/T/#mf211643a0427f8d6495b5b53f8132f453d60ab95 > [2] https://lore.kernel.org/linux-mm/CAHbLzkqa1SCBA10yjWTtA2mKCsoK5+M1BthSDL8ROvUq2XxZMw@mail.gmail.com/T/#me93dff2ccbd9902c3e395e1c022fb454e48ecb1d [FWIW, this is now 4ef9ad19e17676 ("mm: huge_memory: don't force huge page alignment on 32 bit") in mainline] Quick question: it it okay to ask Greg to pick this up for linux-6.7.y series? I'm wondering because Jiri's report ([1] in above quote) sounded like this is something that will affect and annoy quite a few people with the linux-6.7.y. Ciao, Thorsten > Fixes: efa7df3e3bb5 ("mm: align larger anonymous mappings on THP boundaries") > Reported-by: Jiri Slaby > Reported-by: Suren Baghdasaryan > Tested-by: Jiri Slaby > Tested-by: Suren Baghdasaryan > Cc: Rik van Riel > Cc: Matthew Wilcox > Cc: Christopher Lameter > Signed-off-by: Yang Shi > --- > mm/huge_memory.c | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/mm/huge_memory.c b/mm/huge_memory.c > index 94ef5c02b459..e9fbaccbe0c0 100644 > --- a/mm/huge_memory.c > +++ b/mm/huge_memory.c > @@ -37,6 +37,7 @@ > #include > #include > #include > +#include > > #include > #include > @@ -811,6 +812,14 @@ static unsigned long __thp_get_unmapped_area(struct file *filp, > loff_t off_align = round_up(off, size); > unsigned long len_pad, ret; > > + /* > + * It doesn't make too much sense to froce huge page alignment on > + * 32 bit system or compat userspace due to the contrained virtual > + * address space and address entropy. > + */ > + if (IS_ENABLED(CONFIG_32BIT) || in_compat_syscall()) > + return 0; > + > if (off_end <= off_align || (off_end - off_align) < size) > return 0; >