Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp2944734rdb; Tue, 13 Feb 2024 01:56:57 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCX5WskZvpXQ9CE+tPcDvAj8CGEieytMRNvlcfE7n1MzvSQOryFr6rILFw/ILQSADNQT8dSH11gcBLhsK9Bd+raPflSR7M7lYxBcfzqBLA== X-Google-Smtp-Source: AGHT+IEATqPBsAyTLyXZ/bsaJW5uBU6xge7xUyEzpUi+P3omP+1rvMIlfcgQAscMnPpOghoCuLny X-Received: by 2002:a05:622a:48e:b0:42c:3c63:d3dd with SMTP id p14-20020a05622a048e00b0042c3c63d3ddmr11896306qtx.10.1707818217697; Tue, 13 Feb 2024 01:56:57 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707818217; cv=pass; d=google.com; s=arc-20160816; b=O+gxNaFa0MgDVVLCYiJg+8CxrDaO9v+MhKIZ3tIEpkvwV8wTLvGgRQhvZYeI6C7OdA X5uqGSWo0mKPnQVYG8rY+yHWlccInPJtF/aHUDjwO3Sn48s/SI0nrIdXQSFgV7Sj8xbx 0oe+8LCpYp/o1miQcNZDz9HbD5bux/yfh3Tgu4yKHwecthlYgVbxHON+/nIl9uAWfTIN 7gPKSQ8U/tBRfyjURIRAi4t08hfv3hBM00/ZCyV6jb4vnM4foY3WNnzy1KxGK3dUNyoL 2ldtrcYJ8vsvOHMzRw/YCaBkGiaBkSziRFVlQcE2XYRjFVvRESGOgV2AUvzWV3T7vFi4 /EJw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature:dkim-signature; bh=uWRBYrmHPV+rQWKnyw6uQ5jKePWNy4EYeGvU95ElExk=; fh=H0BpcBZ8DTl8W8Il60EGr1Gqq32slYeXMqR0ofejY/A=; b=dVKkqql+ztUC4XkGKeRKKdX4SJcD4kRCKEkWT1NhNRr+fjt61fMyMSLEl/D4FBjlci tcTHKRpPb5+7PX1toQD72ku7YjUFYW4ZmxYDXxlxNWbMausdapTnjhacFNT/Nl0xjx8X as6bUgIhiY9U2Xk2fQ+iRDFot3WvF6urTGa8YfPS2lmWJx+WkrGI42U3X6vRMhx4wCim AFLuX0OPwhMs3cCw8rP6l5XtlEn+XHwsjWWg0dilSl9nZ21qW2tEFeh0py/h4Uws89ys h4kgErBHFrLRNnch9vo5PdWYZqAh1D8Z7egRH0P0O8EzBozQAJGMS+WldXycc02f+wFZ EpZQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=lCzzBvhu; dkim=pass header.i=@suse.com header.s=susede1 header.b=GTw1+siX; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel+bounces-63271-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-63271-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com X-Forwarded-Encrypted: i=2; AJvYcCW3ctV1/vGvlwn7tKZ0Rmw242X3n01RF4lKi6jYuT/m9nv0Jm4YvRd/E5ZSYzaG+5WLBA26F8NyCKEKGysMRxYkSnD+P3ZxY/L3UmGUXw== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id q21-20020ac84515000000b0042c74bcb327si2296165qtn.737.2024.02.13.01.56.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 01:56:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-63271-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; dkim=pass header.i=@suse.com header.s=susede1 header.b=lCzzBvhu; dkim=pass header.i=@suse.com header.s=susede1 header.b=GTw1+siX; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel+bounces-63271-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-63271-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 089651C27B98 for ; Tue, 13 Feb 2024 09:55:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4DAFE22606; Tue, 13 Feb 2024 09:53:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="lCzzBvhu"; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="GTw1+siX" 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 A52C7225D9 for ; Tue, 13 Feb 2024 09:53:00 +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=1707817982; cv=none; b=dM5XcrOQPrzGmyL7B+LNDjDwvFOX8ChqOrnaGm4Kkdxnt+vJXaWLyHUbkEh9/JuOW8HWVSVyg6ORfVRbVZRPEIaoeUJMTBLKXehR+dFiL/srealb0AeukuYXIeVPZ5I5ax+273Xc9YOs/G4BODywBRBvJeXNno5fWBWNFRYbNq8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707817982; c=relaxed/simple; bh=jzPRKNTd3wSLGZSoklskyum2VBJEE5dR6znqH0Wig5k=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=r+jxuO8c/DFsG3JAmrNR0IgsKqPK72c2O5WdIgbXNzE+DRpssR+E08tY7cyPutUu/Lp3DOUAtD/TZBbrwYTjok+uXk3UUrJVQagi9SD4bJCfxJz3DLqOGZz5FNhKUm6WC1zWfCP4squwKXS7AV/wE5VZa5DuwCiN2R2F0LOAUNQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=lCzzBvhu; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=GTw1+siX; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [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 3498B1FC31; Tue, 13 Feb 2024 09:52:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1707817973; 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=uWRBYrmHPV+rQWKnyw6uQ5jKePWNy4EYeGvU95ElExk=; b=lCzzBvhuSR0BNN8x/qcU0Isxya+aUEjuphgBOsr+0Aa2sIcS0WRK50XWNkEgzPdRn6VXi7 wSrMt5wQKV34YlkWZHUwIEX6koJfPhYekovodVAcmkHc68pHvB3pk2bBoGMWCgytLYnL5h QQDLOsuKtRVnbkM+5RgQznkharPIeio= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1707817972; 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=uWRBYrmHPV+rQWKnyw6uQ5jKePWNy4EYeGvU95ElExk=; b=GTw1+siXPr0mxh/bBZ9HQdzkywdXp69EO1xc+nF1dmE/7bpKR9sNhqCRcJouPn1b9necrs SBZSKrn7KiTTUe7xrTWQ3uivC3Kfm8nNS/hdO98nYToaLLgBOYiM+HHN8VPWXr1VwJNIvm sg4MfLsVqmisDdaGTe2Bp4Vwf0XseiQ= 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 161571370C; Tue, 13 Feb 2024 09:52:52 +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 k6pvAvQ7y2XxXwAAD6G6ig (envelope-from ); Tue, 13 Feb 2024 09:52:52 +0000 Date: Tue, 13 Feb 2024 10:52:47 +0100 From: Michal Hocko To: Vlastimil Babka Cc: Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Mel Gorman , Matthew Wilcox , Kent Overstreet , Pasha Tatashin , Mike Rapoport Subject: Re: [PATCH] mm: document memalloc_noreclaim_save() and memalloc_pin_save() Message-ID: References: <20240212182950.32730-2-vbabka@suse.cz> 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: <20240212182950.32730-2-vbabka@suse.cz> Authentication-Results: smtp-out2.suse.de; none X-Spamd-Result: default: False [-2.10 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; BAYES_HAM(-0.00)[29.04%]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_ENVRCPT(0.00)[gmail.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TAGGED_RCPT(0.00)[]; MIME_GOOD(-0.10)[text/plain]; REPLY(-4.00)[]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.com:s=susede1]; RCPT_COUNT_SEVEN(0.00)[9]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:email,suse.cz:email]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; MID_RHS_NOT_FQDN(0.50)[]; FREEMAIL_CC(0.00)[linux-foundation.org,kvack.org,vger.kernel.org,techsingularity.net,infradead.org,gmail.com,soleen.com,linux.ibm.com]; RCVD_TLS_ALL(0.00)[]; SUSPICIOUS_RECIPS(1.50)[] X-Spam-Level: X-Spam-Flag: NO X-Spam-Score: -2.10 On Mon 12-02-24 19:29:51, Vlastimil Babka wrote: > The memalloc_noreclaim_save() function currently has no documentation > comment, so the implications of its usage are not obvious. Namely that > it not only prevents entering reclaim (as the name suggests), but also > allows using all memory reserves and thus should be only used in > contexts that are allocating memory to free memory. This may lead to new > improper usages being added. > > Thus add a documenting comment, based on the description of > __GFP_MEMALLOC. While at it, also document memalloc_pin_save() so that > all the memalloc_ scopes are documented. In the comments describing the > relevant PF_MEMALLOC flags, refer to their scope setting functions. > > Signed-off-by: Vlastimil Babka Acked-by: Michal Hocko Thanks! -- Michal Hocko SUSE Labs