Received: by 2002:a05:7412:3290:b0:fa:6e18:a558 with SMTP id ev16csp507971rdb; Fri, 26 Jan 2024 02:19:44 -0800 (PST) X-Google-Smtp-Source: AGHT+IGpilbLygv+zzJMbVykb42XTJMjeblZDjyZKSLJ5lsh2q4nsYHKW0eXZdnm/RIBP0arfgBp X-Received: by 2002:a05:622a:587:b0:42a:5371:b83d with SMTP id c7-20020a05622a058700b0042a5371b83dmr1191825qtb.96.1706264383959; Fri, 26 Jan 2024 02:19:43 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706264383; cv=pass; d=google.com; s=arc-20160816; b=dNLBjJJMaIRuKznhCmn2CpgY23Xqt4hXxJ9ALbq2NrjXEK7lqc1EIt1nQVgwXg9bqs cLhuhq4Lqz1b4rBN0FzpiEuNqjbBXnXv9nI46xy8CzNDq1au6+h1FGodChY0kounO+9E KhPTGy0qN7vKwY8dj+mVQ2b6i/kqoPTPVCP65VGOliE+WlltZHIUXG4rag/yHqORvb9j BXqm6/gfTbOBEZ4AcgbZDX8l7ybZw/6EvJ+nYbzbv/jKLH28SQLO4rSofxbCcEIHlNjI ZpF96xWkcuEgzdRf896u/QwLPm+cVwy3/01ZRkFpwjBjQbSCSS/uk64HQYpcNJYcUurt SCuQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id; bh=XGLeS98hA2fBZzgTNbeCyAi11v+/7WOKbg0CpbQOuXc=; fh=pg3vzIMDbtmHtvfojx6yqKQ+tuk2dbkoO07D2tkex1E=; b=nX2O2xbkzCTz/j6OzPP64ZqJ2YilT3LxmzcJODsW339x6aXvSfYGQREIZwkrZzGCAU monvNwkQ3hNBo6bBDiPGR8hqzr9Bkg3HOfB0NIAl/IrcVcreESaytPM+gPZFoCLuaMlv rB45dHZiLVHy4N2y1wJifxC4PHp68b35O9pWpf7+WAjiDSi9DlipBCyJLN7lUtqqWFXO wqTwgPZ7Xru4P0Szq/ruZk8JGM/iGJZ4w4mCF2VSDVsXHAgvQhZrIWQajApyIeabNahx M/Nvq05K5H5zRfOVDYc8lPA27ofnMf/jBPE847dMFTneuVA3MoodipfaUPUpApJ9SNHD Bm7A== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-39930-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-39930-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id y5-20020a05622a004500b0042a7f7c835dsi426192qtw.181.2024.01.26.02.19.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jan 2024 02:19:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-39930-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-39930-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-39930-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 6FD791C30419 for ; Fri, 26 Jan 2024 10:12:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A95AA22306; Fri, 26 Jan 2024 09:37:00 +0000 (UTC) Received: from mail-lj1-f170.google.com (mail-lj1-f170.google.com [209.85.208.170]) (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 392E410A0F for ; Fri, 26 Jan 2024 09:36:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706261820; cv=none; b=ECcYDVougReX2m6MmKNjhU7qeafw+y8ywGZWHJgnxnI8r/QTM0UyJH7aQ4KcudfQZ3Jk2LR3CjngVlTxkeL2YtcLdxTrngsc+NO9AxvQyeluYWncUWhcbEHDF4Ucdd+tHPRSl7LvJ+P+eyZAxlNKcDsKcjl8OBdVg0kPHyWzRFg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706261820; c=relaxed/simple; bh=fogrqpb4wPx3QsVi0ooKV6pF4KkSXiEsTUhE8ba15ks=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=hyGlZrrZtjI3vP1mSYXtlUg6iaMfjNg/rF76MU/MAk3OXk4Qo1usW4eMUoYSqBW213Rf8UsZx+/3DsEdHB9+o+fGPyyOZvejzo/Xb30hbUaR64shj8GwDShki9oG8CQYBh9FcaV21lwUl9DHDu4DG/AMPUsLau84tqOvDHYJfS0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.208.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lj1-f170.google.com with SMTP id 38308e7fff4ca-2cf1b770833so6501561fa.0 for ; Fri, 26 Jan 2024 01:36:57 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706261816; x=1706866616; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=XGLeS98hA2fBZzgTNbeCyAi11v+/7WOKbg0CpbQOuXc=; b=cX9LaqYS5mZUvLEW3nUfPnjRWvVu0SGPGtcYXAf0OivSplEDi3FQ791IeBUyfasY8c +ojpDhKxtsfjVIMrfIUjBklSpwudS/EwMIu6auTbh31VZFAWwUvAJPWwba+gerChYBt0 2yIGB3pYRuiCqNaDratVBn46VaM0p1wj4Fd0+5fw5e4oIiigOWq0rmHuHw1v0YdZyDfR j/LCSKgNqH1NKdoOpc5PVr7y3CvnAzhMT1vRBbNAgetHtdR8vQzgGLTHc5bTFthsLjA1 gXvSjgPYh61o3ZpPATVVC6y4q32C7OBETGwRrgm26GrBH7FyuLI8NJoMZLuIMNuwbMvf /tYg== X-Gm-Message-State: AOJu0Yyg85QtOx79sO/9V07PwCFuFEU8vClnx0bILIsMQUT6k9Yp8C3o n+R/+/m3kALR1dh8eP57Biv+hoLWs51mIN1DldafED402IUeNWTk X-Received: by 2002:a2e:a36b:0:b0:2cf:429f:7fbb with SMTP id i11-20020a2ea36b000000b002cf429f7fbbmr538120ljn.72.1706261815777; Fri, 26 Jan 2024 01:36:55 -0800 (PST) Received: from ?IPV6:2a0b:e7c0:0:107::aaaa:59? ([2a0b:e7c0:0:107::aaaa:59]) by smtp.gmail.com with ESMTPSA id o23-20020aa7dd57000000b0055c8a30152bsm405245edw.83.2024.01.26.01.36.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 26 Jan 2024 01:36:55 -0800 (PST) Message-ID: <2afa54e6-90db-4ae0-a21c-78e5051aa83c@kernel.org> Date: Fri, 26 Jan 2024 10:36:53 +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 To: akpm@linux-foundation.org Cc: surenb@google.com, riel@surriel.com, willy@infradead.org, cl@linux.com, yang@os.amperecomputing.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, "Bernhard M. Wiedemann" , Michal Hocko , Yang Shi References: <20240118133504.2910955-1-shy828301@gmail.com> From: Jiri Slaby Autocrypt: addr=jirislaby@kernel.org; keydata= xsFNBE6S54YBEACzzjLwDUbU5elY4GTg/NdotjA0jyyJtYI86wdKraekbNE0bC4zV+ryvH4j rrcDwGs6tFVrAHvdHeIdI07s1iIx5R/ndcHwt4fvI8CL5PzPmn5J+h0WERR5rFprRh6axhOk rSD5CwQl19fm4AJCS6A9GJtOoiLpWn2/IbogPc71jQVrupZYYx51rAaHZ0D2KYK/uhfc6neJ i0WqPlbtIlIrpvWxckucNu6ZwXjFY0f3qIRg3Vqh5QxPkojGsq9tXVFVLEkSVz6FoqCHrUTx wr+aw6qqQVgvT/McQtsI0S66uIkQjzPUrgAEtWUv76rM4ekqL9stHyvTGw0Fjsualwb0Gwdx ReTZzMgheAyoy/umIOKrSEpWouVoBt5FFSZUyjuDdlPPYyPav+hpI6ggmCTld3u2hyiHji2H cDpcLM2LMhlHBipu80s9anNeZhCANDhbC5E+NZmuwgzHBcan8WC7xsPXPaiZSIm7TKaVoOcL 9tE5aN3jQmIlrT7ZUX52Ff/hSdx/JKDP3YMNtt4B0cH6ejIjtqTd+Ge8sSttsnNM0CQUkXps w98jwz+Lxw/bKMr3NSnnFpUZaxwji3BC9vYyxKMAwNelBCHEgS/OAa3EJoTfuYOK6wT6nadm YqYjwYbZE5V/SwzMbpWu7Jw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yzqzffzBLXZCujlYQ DFXpyMNVJ2ZwPmX2mWEoYuaBU0JN7wM+/zWgOf2zRwhEuD3A2cO2PxoiIfyUEfB9SSmffaK/ S4xXoB6wvGENZ85Hg37C7WDNdaAt6Xh2uQIly5grkgvWppkNy4ZHxE+jeNsU7tg= In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 25. 01. 24, 9:53, Michal Hocko wrote: > On Thu 18-01-24 05:35:04, 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 >> >> 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 > > Acked-by: Michal Hocko > > Thanks! > >> --- >> 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. >> + */ FWIW, Bernhard noticed that "froce" and "contrained", could you fix that before applying the patch? thanks, -- js suse labs