From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (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 448DA22AE47 for ; Mon, 13 Jan 2025 11:20:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736767242; cv=none; b=pkvyFgPicpOQ23IAqkcKymQ034Gs6/725HPe/71OLSFRvV9WVBFcGU406BgUBB5d6U9/sz94i1MytGOu4BTYrCtIHppuS51fju8iaQuYxVz47FfzIwcZ/Zry4iV2b020b1R9go+Q7PeejaNvphtUCbfdBJao/HUNIeBHNCJ35/A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736767242; c=relaxed/simple; bh=liBUtRxcOUlInQD/MdIE4oXMItqCCeohb7cl2RlEKiQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=KkIWT+iG21EgExKpNbXE8auT0TkxthOv6It+PMP27kKOCJR38UfVu7PPEuQgPL/NAKVUeYlp3Zephomaeu5TlLFAwD4U1JiL+l4w+IA7zyGXYoMnnrvj7eJMFlop9YMpm/LLlGunVBAFAn7Sb3J3Q2wNxP8XpAu2IO/XBlGU5Mo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=QkrQ1v3p; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=ZBD/cQ7D; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=OyBUjY5t; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=ebHlzOCt; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="QkrQ1v3p"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="ZBD/cQ7D"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="OyBUjY5t"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="ebHlzOCt" Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 0B6231F394; Mon, 13 Jan 2025 11:20:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1736767238; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=5Ex4DSpDyhXu7OV/KZcfCs/SOVwPCwbltBOdcf3td5g=; b=QkrQ1v3pIk4KD76ZZasZAfCL4FkQk7To/iJaSX3wz9rlYpiplJdKp1X6tz+0MxWwgKUMCN MhNOyPY1UpXD2hjWjKyYJir/qVpN0OuLy+A7ZEQw9YG4N8SUxWLskFPTmgilUCAfj40bhj 6utLp644Ru5OfiK5oQe5JeKAdgxACHk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1736767238; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=5Ex4DSpDyhXu7OV/KZcfCs/SOVwPCwbltBOdcf3td5g=; b=ZBD/cQ7Dh0aWp10l4VP6KcZCg/3K1g2OEV5CJLV70GnM1DaPW72kk47ahoYk71AY2e/rfg oT6NY5iZu9JQgVAw== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1736767237; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=5Ex4DSpDyhXu7OV/KZcfCs/SOVwPCwbltBOdcf3td5g=; b=OyBUjY5tcICAPS2ur4Pnz27ummmqNc2qerZxDIab5h41N+xViix08xEzfJM1eQ8L+OYYl6 1o/9SpIRbjSmKDGLpctSgTaPs8p9vKiVvbWPIvPQ6z5CZ8TyKv7Y2dnygHsGSoUg606BDY d9xbUySwNAMQVTOI2f3E5NuJHaOCmlA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1736767237; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=5Ex4DSpDyhXu7OV/KZcfCs/SOVwPCwbltBOdcf3td5g=; b=ebHlzOCt0r2WURmMK0jdLRGw7WOj49Em+P0mXWWDULlmtG+OVovE91UntYaw7np58v1Ku8 /zd4oz8pBidZmGCQ== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 603F613876; Mon, 13 Jan 2025 11:20:36 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id AtScFAT3hGfTegAAD6G6ig (envelope-from ); Mon, 13 Jan 2025 11:20:36 +0000 Date: Mon, 13 Jan 2025 12:20:34 +0100 From: Oscar Salvador To: Peter Xu Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Breno Leitao , Rik van Riel , Muchun Song , Naoya Horiguchi , Roman Gushchin , Ackerley Tng , Andrew Morton Subject: Re: [PATCH v2 3/7] mm/hugetlb: Rename avoid_reserve to cow_from_owner Message-ID: References: <20250107204002.2683356-1-peterx@redhat.com> <20250107204002.2683356-4-peterx@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20250107204002.2683356-4-peterx@redhat.com> X-Spam-Score: -2.80 X-Spamd-Result: default: False [-2.80 / 50.00]; BAYES_HAM(-3.00)[99.99%]; SUSPICIOUS_RECIPS(1.50)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; TAGGED_RCPT(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCPT_COUNT_SEVEN(0.00)[10]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; MISSING_XM_UA(0.00)[]; FREEMAIL_ENVRCPT(0.00)[gmail.com]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FROM_HAS_DN(0.00)[]; FREEMAIL_CC(0.00)[kvack.org,vger.kernel.org,debian.org,surriel.com,linux.dev,gmail.com,google.com,linux-foundation.org]; TO_DN_SOME(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FUZZY_BLOCKED(0.00)[rspamd.com]; DBL_BLOCKED_OPENRESOLVER(0.00)[localhost.localdomain:mid,imap1.dmz-prg2.suse.org:helo,suse.de:email] X-Spam-Flag: NO X-Spam-Level: On Tue, Jan 07, 2025 at 03:39:58PM -0500, Peter Xu wrote: > The old name "avoid_reserve" can be too generic and can be used wrongly in > the new call sites that want to allocate a hugetlb folio. > > It's confusing on two things: (1) whether one can opt-in to avoid global > reservation, and (2) whether it should take more than one count. > > In reality, this flag is only used in an extremely hacky path, in an > extremely hacky way in hugetlb CoW path only, and always use with 1 saying > "skip global reservation". Rename the flag to avoid future abuse of this > flag, making it a boolean so as to reflect its true representation that > it's not a counter. To make it even harder to abuse, add a comment above > the function to explain it. > > Signed-off-by: Peter Xu I agree that the current name is quite misleading, and this patch improves the situation substantially. The only thing I am missing here is that the comment you added could be more explanatory as to why new call sites do not want to make use of the flag. IIRC, not using so, will bypass all vma level reservations as you mentioned, which means that the child can get killed if the parent makes use of the page, as it is the parent the only one that made a reservation. So maybe dropping a hint would be nice. Reviewed-by: Oscar Salvador -- Oscar Salvador SUSE Labs