Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp2526258rdb; Mon, 5 Feb 2024 09:07:39 -0800 (PST) X-Google-Smtp-Source: AGHT+IH+uwSOFtn77eIdS8pWfKxwsywVdcrrnqAxz2jlK3dIpuX1drk35RdipSac71ELtNkhR5hz X-Received: by 2002:a05:651c:104f:b0:2d0:b2ce:a90f with SMTP id x15-20020a05651c104f00b002d0b2cea90fmr215914ljm.43.1707152859760; Mon, 05 Feb 2024 09:07:39 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707152859; cv=pass; d=google.com; s=arc-20160816; b=eITgYDMDcM2ws90Z4JlTgtBYr4HUWDSZ6Y65rnhIWGNaQmYElG5YNtgT8+kSs68MmZ 2SkgIg9e6i1pZpA4t7C9puiDXx29IvdpM+m8CQpI7JHJO1QkI8mVdQ+MARo8yvJoyClE a8/9nM0Qo4DC34NdrsBn3/rnOpzMwkKIDg2ydNZZbIxkETY350rfRvx7Hh3HKER46Ypm mKyBiFu4hZqtBMtEIM4w4SyRT2ss0WPdx4nL4ZtfGPYJ2S79TKt1+g4V0xfekMPf+dVw RfwWXK7ZL4/HSDJgA8vVq/YCri+EheM3g97sp86JuD90QU5uFKR6Ol2tktXKmHyq2o8o WaKg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=88D1RK/nOy77l4ZbsApJZs4VjFYfeQsWMWLEgTtNVGA=; fh=vKZJFVPw1mOkdyBHdd7q8PpU4SLynKTobkEypTwZwWA=; b=phvrJJ/LR7bIbpwYBP+uZPO420A7l48kVLDIuX0/OPwukQN2hMqH2ptGf8KV67QeVh PiBzyrr5yAeL5Seyt51M8WJ/TLpspGj0ElfVdx0XQMebCwyifZ6Q3v/HbE4vO/Kbgq3n 11ruFd9wTSJXcBug6VlACw1+zXrXS9KNh2NnMDA/3BhVKLvupELCal7rf+AgJJxMfLqD RpoygirJcDLqtotyE4NINEUvvBCHWCJk3mk3s2Ael1rtbrW3PU1+TykPcrjurZ2zlWnD oY1EwStLm8TCWzOzGLvthfmzljNE8Fvp3VHQwrdvzRAr1q8MIs9eg9ZY6GZB1NEQD4KF DSMg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=duG0H4Lp; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-53061-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-53061-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com X-Forwarded-Encrypted: i=1; AJvYcCX46uHs2xiDs+4iq5Cip2x0jWdk52J5GgHsamaVrLu5hwGeSXaLOxmavrFHnJkxpLPvh3gint1K5Esb3POBclNyGe747zeZrotCHNjc3Q== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id b8-20020aa7cd08000000b005603c57cc76si74538edw.535.2024.02.05.09.07.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Feb 2024 09:07:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-53061-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; dkim=pass header.i=@gmail.com header.s=20230601 header.b=duG0H4Lp; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-53061-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-53061-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 7B6BC1F22C5B for ; Mon, 5 Feb 2024 17:07:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 05E7244C66; Mon, 5 Feb 2024 17:07:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="duG0H4Lp" Received: from mail-pf1-f171.google.com (mail-pf1-f171.google.com [209.85.210.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B69A944C64 for ; Mon, 5 Feb 2024 17:07:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707152851; cv=none; b=UuPokKd9q/LzfpbpKmR1pYdxL9uNcTAU20y/YZpvSRO15KYENobGSKikiP0AlXAs5ox7ughWTtkNEw8Zbi9o6tBLRZslQFEehJBVvY89mOXRGUTY2qrqfKdS+Ek1Fhc14NjIWBQNcS7ezrI9eum7AJq9pnYHjGGs+2Ch4IMsxuU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707152851; c=relaxed/simple; bh=2Q1i1RHrUxU6byBUfds2Q8JCnwTEHlAU9LNt9f1skVs=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=dJE3JALaZXWzH9Vtr96Didry99oKeM/5Ed37F3dvriPqfn90vsiOjOcLG4yw4EL/8Q3M9TO9r/qBBoV9b/Jvi2SqIKDhAmF0CjJ5Qyb+0tLOHmLSrsiWYcACxNzM6Qcjz8ik/Ev4KMe1IktDed0Sf+CipGbb3LKkG0XJCd1k+DM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=duG0H4Lp; arc=none smtp.client-ip=209.85.210.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pf1-f171.google.com with SMTP id d2e1a72fcca58-6e04e7b687bso400992b3a.0 for ; Mon, 05 Feb 2024 09:07:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707152849; x=1707757649; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=88D1RK/nOy77l4ZbsApJZs4VjFYfeQsWMWLEgTtNVGA=; b=duG0H4Lpk6EddW3Ie97Z8gfy+ThPpcHK/t8W0GPR37yrkuDzVXHEhfQ2ScyYupUgZl bfTCMi8eJ66ul6/CbkhmYuziC6IKi9QzSMHiN/4wHZbDHi+i1xuqkdMPB0IKxYWK4b2e KuwkFaKGXBWEdQK/kYqI5t1EhaYd4DMUXnsJVkSSznt7DtuL35ALNgwyHeBEQRZHYwuY alVyn+i76Kxq9UcXbz6K98Sr2Rh00tqd7UQmBrvT2GHXhdnMshqi+pEP5NqxW1XRHzYR EmCQpn4sHUzBBXtZOdjzOxAbKKHxUxXdm/hT2Z+85XhpmujAcFaeJ0Az1s8Aq8m30aIQ xnHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707152849; x=1707757649; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=88D1RK/nOy77l4ZbsApJZs4VjFYfeQsWMWLEgTtNVGA=; b=hfCYtYdeRSvUBSciLcAChSBqplbB1xokHT9D20i8HdQdOjf+A13MmzDcRF72v+US3h mR8UPA3TgGC4bg66PAGhdE+OXRmbB5Lunk4WmRIThmRkQYQ8PGIVtJVFnGrx/Ez+z6PR Bbh5OM2OFmUoaVEFaFlYSX2ptmYmJhCh6dOwOjScdh0qLarSU0Vb7hYlZrfjgA2TPZzH tiDjIb1x//X75TUkyUZuiiJnZAzoB46n/PvcozKWQ8VeN9IpRsnI2dOiCPfugRqz3074 QuuR3lDFVpe6T5HhsEdaBiOFx4hHZT0rbbbhnm5RyAA5FFKEqoZ4+HoHcl22B+R7mO6K 0VEw== X-Gm-Message-State: AOJu0YwRNP543VgsooSpqncRWE+LYkzxJKNGmSBQ4cp06Pzrc4L+4lNz pzTnmMRH6CjFr9PVgLZMOE6p0cgIDJ++RAFR8Xgvyu0mXSSniMhEQ934EXt/7L9LVHHx3SKnS6U G3GuSs6I14OMYIGFd3kVz0rTOg8k= X-Received: by 2002:a05:6a20:7291:b0:19a:1cff:f574 with SMTP id o17-20020a056a20729100b0019a1cfff574mr141172pzk.36.1707152848960; Mon, 05 Feb 2024 09:07:28 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240118133504.2910955-1-shy828301@gmail.com> In-Reply-To: From: Yang Shi Date: Mon, 5 Feb 2024 09:07:16 -0800 Message-ID: Subject: Re: [PATCH] mm: huge_memory: don't force huge page alignment on 32 bit To: Thorsten Leemhuis Cc: jirislaby@kernel.org, surenb@google.com, riel@surriel.com, willy@infradead.org, cl@linux.com, akpm@linux-foundation.org, Linux kernel regressions list , yang@os.amperecomputing.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sat, Feb 3, 2024 at 1:24=E2=80=AFAM Thorsten Leemhuis wrote: > > 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 com= pat > > 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+M1B= thSDL8ROvUq2XxZMw@mail.gmail.com/T/#mf211643a0427f8d6495b5b53f8132f453d60ab= 95 > > [2] https://lore.kernel.org/linux-mm/CAHbLzkqa1SCBA10yjWTtA2mKCsoK5+M1B= thSDL8ROvUq2XxZMw@mail.gmail.com/T/#me93dff2ccbd9902c3e395e1c022fb454e48ecb= 1d > > [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? Yes, definitely. Thanks for following up. Yang > > 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 bounda= ries") > > 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(struc= t file *filp, > > loff_t off_align =3D 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 virtua= l > > + * address space and address entropy. > > + */ > > + if (IS_ENABLED(CONFIG_32BIT) || in_compat_syscall()) > > + return 0; > > + > > if (off_end <=3D off_align || (off_end - off_align) < size) > > return 0; > >