Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3542022pxb; Mon, 24 Jan 2022 11:48:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJzGHMIwYUiWfuuwY8UmykVNteA0drqtAddixTTBs2JSe16zdCTLlx3AKBPMT5nell5jG+AF X-Received: by 2002:a17:90b:17c4:: with SMTP id me4mr3453513pjb.198.1643053738680; Mon, 24 Jan 2022 11:48:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643053738; cv=none; d=google.com; s=arc-20160816; b=GiWSQTzXCqD8Gnt68Nqb3evb3oICB88umHnYNSwq5Vt9RMj2HOHIUcjy6qpBAgAHq2 Aigcf5w68nxcfPBBkLFkmED/Af6vLR5o3FTYtZwqy0uqInF1oGOyKPbFsafPp2DGhStx n2zlRNTsZuClCfLm8ItO3RQ0KGAZHEd0wWniW8wQEnOxEPP6njegTGcJ1RR2OdDQKIcj aZ5ao3gKXLceNdtPNz4w7czRloYNWkSvlj/OUFomDEtCpRvGf9YN4gHY7OsZkNNiI4ET lLbcNt5/80BAQq31NDsm2EWYkGqcbVK55EFJqtagka/pTI9DIMETuePN798KdXAcBAWq Ae2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=jPJkDDMANdyat2fWnF0ePoGcf0BIkGWaR4hg7xwqn8k=; b=x+aG7g5B50/xjlhTG2CMVOuMh5wo9evbCysYzKDq+sHc5j9bW6D/gpVfyrb0CLd4NQ /k+keDbW260AXLOF3dD4hcoO9Vub1ceLGu3Mky8ExUaOvL6SgdhVyhbnUOEJf+JrDwoL vm3DyqzmZLK7NRhqDTrXSLOgiz9vcXqJgfKs9WKkeqLZJsMjQnJyHQp7WR0m4jNsQUS8 y8aP+doTl+wnSJLfSpegtaW91iZQZoc2cV+jiJTxn3gIK+QqkA//QGGEibFImQes5KHs Txv4Q6eHCVUSTrDeikLHOJrMQ5Fx1/M7HOdVXVw3+3l4Y9kjeErIyDY9kLGxwU9YRYdT ZZsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=ZoBLjoIt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d4si14623422pgv.688.2022.01.24.11.48.46; Mon, 24 Jan 2022 11:48:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=ZoBLjoIt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244857AbiAXSDl (ORCPT + 99 others); Mon, 24 Jan 2022 13:03:41 -0500 Received: from out2.migadu.com ([188.165.223.204]:12760 "EHLO out2.migadu.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244829AbiAXSDb (ORCPT ); Mon, 24 Jan 2022 13:03:31 -0500 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1643047410; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jPJkDDMANdyat2fWnF0ePoGcf0BIkGWaR4hg7xwqn8k=; b=ZoBLjoItkBYiLDVjQCAG94tzu6wf2wg89Sw9dCcqUhfm1aqgwiYkw8wjm5xKXxVLfNVsvV SBf1b93QedIZO3v7xP4JzGVevTCVYBl83BeIF/VFMjbBp9Ku9RLC3jCoxEpz4b/XBmgJDp o6wv6GGcbItgG2r8eUrh8Ys1T3p9IHE= From: andrey.konovalov@linux.dev To: Andrew Morton Cc: Andrey Konovalov , Marco Elver , Alexander Potapenko , Dmitry Vyukov , Andrey Ryabinin , kasan-dev@googlegroups.com, linux-mm@kvack.org, Vincenzo Frascino , Catalin Marinas , Will Deacon , Mark Rutland , linux-arm-kernel@lists.infradead.org, Peter Collingbourne , Evgenii Stepanov , linux-kernel@vger.kernel.org, Andrey Konovalov Subject: [PATCH v6 07/39] mm: clarify __GFP_ZEROTAGS comment Date: Mon, 24 Jan 2022 19:02:15 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: linux.dev Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andrey Konovalov __GFP_ZEROTAGS is intended as an optimization: if memory is zeroed during allocation, it's possible to set memory tags at the same time with little performance impact. Clarify this intention of __GFP_ZEROTAGS in the comment. Signed-off-by: Andrey Konovalov --- Changes v4->v5: - Mention optimization intention in the comment. --- include/linux/gfp.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/linux/gfp.h b/include/linux/gfp.h index 80f63c862be5..581a1f47b8a2 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h @@ -232,8 +232,10 @@ struct vm_area_struct; * * %__GFP_ZERO returns a zeroed page on success. * - * %__GFP_ZEROTAGS returns a page with zeroed memory tags on success, if - * __GFP_ZERO is set. + * %__GFP_ZEROTAGS zeroes memory tags at allocation time if the memory itself + * is being zeroed (either via __GFP_ZERO or via init_on_alloc). This flag is + * intended for optimization: setting memory tags at the same time as zeroing + * memory has minimal additional performace impact. * * %__GFP_SKIP_KASAN_POISON returns a page which does not need to be poisoned * on deallocation. Typically used for userspace pages. Currently only has an -- 2.25.1