From patchwork Mon Feb 15 20:49:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 12089175 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6B943C433E0 for ; Mon, 15 Feb 2021 20:49:18 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 80F7F64DE0 for ; Mon, 15 Feb 2021 20:49:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 80F7F64DE0 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id EC9E98D013D; Mon, 15 Feb 2021 15:49:16 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id EA1858D012C; Mon, 15 Feb 2021 15:49:16 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DB68A8D013D; Mon, 15 Feb 2021 15:49:16 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0189.hostedemail.com [216.40.44.189]) by kanga.kvack.org (Postfix) with ESMTP id C133A8D012C for ; Mon, 15 Feb 2021 15:49:16 -0500 (EST) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 885FF18296D0C for ; Mon, 15 Feb 2021 20:49:16 +0000 (UTC) X-FDA: 77821692312.01.uncle44_3b070ad2763e Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin01.hostedemail.com (Postfix) with ESMTP id 6D1911005985E for ; Mon, 15 Feb 2021 20:49:16 +0000 (UTC) X-HE-Tag: uncle44_3b070ad2763e X-Filterd-Recvd-Size: 3455 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf38.hostedemail.com (Postfix) with ESMTP for ; Mon, 15 Feb 2021 20:49:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:In-Reply-To:References; bh=LzIBQJo+Q6ka8/V01e0VaV8qOu6tDfADsuFPvFsk1Cw=; b=D7avk+Fp0GJthChNVr69sMQbPq OBK2GMidPLyfkPEMnaYQZDVuIaDhCLZB1JEI48rFwdaAjONOPzcy69FWhVJ2EHjkRPS/6ATqiB34C apADZuHccYLX4IcgOcOa4NMVk+YVznzo0DzfiudbGl0AODkOL8PZsKcwyvomO2p1t7VR731zDHgr9 PQQADG8frDT14p1Qtk8pA/PUqcFHbWQxtghkZosAHA/NItlLxH7dUFN2cNWgLpakKqUNQLT26wM47 xBvLQpiYerfDYNGboAUNBng5q4NnnCs+VzpSBOCPnjN/5yLi7KBxySLJ9AWcm6ZWo2nRw2x47sWfC 1QSo9U4A==; Received: from willy by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1lBknu-00G2wR-MG; Mon, 15 Feb 2021 20:49:11 +0000 From: "Matthew Wilcox (Oracle)" To: Andrew Morton Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org, Mike Rapoport Subject: [PATCH] mm/gfp: Add kernel-doc for gfp_t Date: Mon, 15 Feb 2021 20:49:09 +0000 Message-Id: <20210215204909.3824509-1-willy@infradead.org> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: The generated html will link to the definition of the gfp_t automatically once we define it. Move the one-paragraph overview of GFP flags from the documentation directory into gfp.h and pull gfp.h into the documentation. Signed-off-by: Matthew Wilcox (Oracle) Acked-by: Mike Rapoport --- Documentation/core-api/mm-api.rst | 7 ++----- include/linux/gfp.h | 11 +++++++++++ 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/Documentation/core-api/mm-api.rst b/Documentation/core-api/mm-api.rst index 2adffb3f7914..201b5423303b 100644 --- a/Documentation/core-api/mm-api.rst +++ b/Documentation/core-api/mm-api.rst @@ -19,11 +19,8 @@ User Space Memory Access Memory Allocation Controls ========================== -Functions which need to allocate memory often use GFP flags to express -how that memory should be allocated. The GFP acronym stands for "get -free pages", the underlying memory allocation function. Not every GFP -flag is allowed to every function which may allocate memory. Most -users will want to use a plain ``GFP_KERNEL``. +.. kernel-doc:: include/linux/gfp.h + :internal: .. kernel-doc:: include/linux/gfp.h :doc: Page mobility and placement hints diff --git a/include/linux/gfp.h b/include/linux/gfp.h index 52cd415b436c..ecd1b5d27936 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h @@ -8,6 +8,17 @@ #include #include +/** + * typedef gfp_t - Memory allocation flags. + * + * GFP flags are commonly used throughout Linux to indicate how memory + * should be allocated. The GFP acronym stands for "get free pages", + * the underlying memory allocation function. Not every GFP flag is + * supported by every function which may allocate memory. Most users + * will want to use a plain ``GFP_KERNEL``. + */ +typedef unsigned int __bitwise gfp_t; // repeated here for kernel-doc + struct vm_area_struct; /*