From patchwork Thu Feb 25 15:06:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 12104255 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,URIBL_BLOCKED,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 5ACA8C433DB for ; Thu, 25 Feb 2021 15:09:50 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id DB7C564F16 for ; Thu, 25 Feb 2021 15:09:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DB7C564F16 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 758A58D0002; Thu, 25 Feb 2021 10:09:49 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 705476B0078; Thu, 25 Feb 2021 10:09:49 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5CDD58D0002; Thu, 25 Feb 2021 10:09:49 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0131.hostedemail.com [216.40.44.131]) by kanga.kvack.org (Postfix) with ESMTP id 420D36B0075 for ; Thu, 25 Feb 2021 10:09:49 -0500 (EST) Received: from smtpin05.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 12FF4824C451 for ; Thu, 25 Feb 2021 15:09:49 +0000 (UTC) X-FDA: 77857124898.05.2BC4863 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf06.hostedemail.com (Postfix) with ESMTP id B5C6FC001C5A for ; Thu, 25 Feb 2021 15:09:44 +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: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=rvJbJEMr2dM/jYbZ5QQJ7q6Sfn5oAstScJ/46/ycLSo=; b=NKjbfpBYyjrjfYZFUG6GByY+eE Zgsveu8dEzpVuotRuEko+p1JSm84FsSXH9Q1KlAJo+c9yiSizugXz7h6V2UaVW3dcyZeBFZzvzBkn FhxEhc3XPTGBJULtpps8UiAyg6Tixs/eHHLy0HtGstGAd9J8vtYzZgX0v2O6iXmjzRh6ru8wEWt5E PgaldqXsEZ94uRfYhnzkMgOboG3nEZayVLucIpaUYNS0jvUaxq/VlYE/bYLrXPt1n6gkJq1Qlethv 8lp7BriwrzjOOoJI4o2Z5geOvAavCOed1U7WSvH58Kb7QQCe5MsMQ183sU/ohw3nK18Pp7OhU/ug5 yQMJL3WQ==; Received: from willy by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1lFIGD-00Apsm-TK; Thu, 25 Feb 2021 15:09:07 +0000 From: "Matthew Wilcox (Oracle)" To: Andrew Morton Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org, Mike Rapoport Subject: [PATCH v3 6/7] mm/mempolicy: Rewrite alloc_pages_vma documentation Date: Thu, 25 Feb 2021 15:06:41 +0000 Message-Id: <20210225150642.2582252-7-willy@infradead.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210225150642.2582252-1-willy@infradead.org> References: <20210225150642.2582252-1-willy@infradead.org> MIME-Version: 1.0 X-Stat-Signature: 7hzydg341swuexg4pfhc81n8o8hnyqkh X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: B5C6FC001C5A Received-SPF: none (infradead.org>: No applicable sender policy available) receiver=imf06; identity=mailfrom; envelope-from=""; helo=casper.infradead.org; client-ip=90.155.50.34 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1614265784-988229 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 current formatting doesn't quite work with kernel-doc. Signed-off-by: Matthew Wilcox (Oracle) Acked-by: Mike Rapoport Acked-by: Vlastimil Babka --- mm/mempolicy.c | 34 +++++++++++++--------------------- 1 file changed, 13 insertions(+), 21 deletions(-) diff --git a/mm/mempolicy.c b/mm/mempolicy.c index 24c2100fccba..6d0fe85d4f8d 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c @@ -2153,30 +2153,22 @@ static struct page *alloc_page_interleave(gfp_t gfp, unsigned order, } /** - * alloc_pages_vma - Allocate a page for a VMA. - * - * @gfp: - * %GFP_USER user allocation. - * %GFP_KERNEL kernel allocations, - * %GFP_HIGHMEM highmem/user allocations, - * %GFP_FS allocation should not call back into a file system. - * %GFP_ATOMIC don't sleep. + * alloc_pages_vma - Allocate a page for a VMA. + * @gfp: GFP flags. + * @order: Order of the GFP allocation. + * @vma: Pointer to VMA or NULL if not available. + * @addr: Virtual address of the allocation. Must be inside @vma. + * @node: Which node to prefer for allocation (modulo policy). + * @hugepage: For hugepages try only the preferred node if possible. * - * @order:Order of the GFP allocation. - * @vma: Pointer to VMA or NULL if not available. - * @addr: Virtual Address of the allocation. Must be inside the VMA. - * @node: Which node to prefer for allocation (modulo policy). - * @hugepage: for hugepages try only the preferred node if possible + * Allocate a page for a specific address in @vma, using the appropriate + * NUMA policy. When @vma is not NULL the caller must hold the mmap_lock + * of the mm_struct of the VMA to prevent it from going away. Should be + * used for all allocations for pages that will be mapped into user space. * - * This function allocates a page from the kernel page pool and applies - * a NUMA policy associated with the VMA or the current process. - * When VMA is not NULL caller must read-lock the mmap_lock of the - * mm_struct of the VMA to prevent it from going away. Should be used for - * all allocations for pages that will be mapped into user space. Returns - * NULL when no page can be allocated. + * Return: The page on success or NULL if allocation fails. */ -struct page * -alloc_pages_vma(gfp_t gfp, int order, struct vm_area_struct *vma, +struct page *alloc_pages_vma(gfp_t gfp, int order, struct vm_area_struct *vma, unsigned long addr, int node, bool hugepage) { struct mempolicy *pol;