From patchwork Mon May 10 01:49:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen Li X-Patchwork-Id: 12246673 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=-13.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_RED 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 7D2F0C433B4 for ; Mon, 10 May 2021 01:49:19 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 99677613DF for ; Mon, 10 May 2021 01:49:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 99677613DF Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=uniontech.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id F0B5C6B0070; Sun, 9 May 2021 21:49:17 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E95206B0071; Sun, 9 May 2021 21:49:17 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CE6046B0072; Sun, 9 May 2021 21:49:17 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0223.hostedemail.com [216.40.44.223]) by kanga.kvack.org (Postfix) with ESMTP id ADE466B0070 for ; Sun, 9 May 2021 21:49:17 -0400 (EDT) Received: from smtpin27.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 5583098A6 for ; Mon, 10 May 2021 01:49:17 +0000 (UTC) X-FDA: 78123638754.27.012D338 Received: from regular1.263xmail.com (regular1.263xmail.com [211.150.70.198]) by imf09.hostedemail.com (Postfix) with ESMTP id 6DA1F600010A for ; Mon, 10 May 2021 01:49:04 +0000 (UTC) Received: from localhost (unknown [192.168.167.69]) by regular1.263xmail.com (Postfix) with ESMTP id B663E721; Mon, 10 May 2021 09:49:11 +0800 (CST) X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-ADDR-CHECKED4: 1 X-ANTISPAM-LEVEL: 2 X-SKE-CHECKED: 1 X-ABS-CHECKED: 1 Received: from manjaro.uniontech.com (unknown [58.246.122.242]) by smtp.263.net (postfix) whith ESMTP id P19990T140047247578880S1620611350997414_; Mon, 10 May 2021 09:49:11 +0800 (CST) X-IP-DOMAINF: 1 X-UNIQUE-TAG: <25582c515e01310e114fb80fc20a4e83> X-RL-SENDER: chenli@uniontech.com X-SENDER: chenli@uniontech.com X-LOGIN-NAME: chenli@uniontech.com X-FST-TO: akpm@linux-foundation.org X-RCPT-COUNT: 6 X-SENDER-IP: 58.246.122.242 X-ATTACHMENT-NUM: 0 X-System-Flag: 0 Date: Mon, 10 May 2021 09:49:11 +0800 Message-ID: <87tunb2wa0.wl-chenli@uniontech.com> From: Chen Li To: akpm@linux-foundation.org Cc: mm-commits@vger.kernel.org, David Hildenbrand , Matthew Wilcox , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] nommu: remove __GFP_HIGHMEM in vmalloc/vzalloc In-Reply-To: <20210509041323.k6DtiMDiu%akpm@linux-foundation.org> References: <20210509041323.k6DtiMDiu%akpm@linux-foundation.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?iso-8859-4?q?Goj=F2?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/28.0.50 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 6DA1F600010A X-Stat-Signature: 35xkr789714qp156h9dii56kunjo6sec Authentication-Results: imf09.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf09.hostedemail.com: domain of chenli@uniontech.com designates 211.150.70.198 as permitted sender) smtp.mailfrom=chenli@uniontech.com Received-SPF: none (uniontech.com>: No applicable sender policy available) receiver=imf09; identity=mailfrom; envelope-from=""; helo=regular1.263xmail.com; client-ip=211.150.70.198 X-HE-DKIM-Result: none/none X-HE-Tag: 1620611344-859040 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: On Sun, 09 May 2021 12:13:23 +0800, akpm@linux-foundation.org wrote: > > > The patch titled > Subject: nommu-remove-__gfp_highmem-in-vmalloc-vzalloc-checkpatch-fixes > has been added to the -mm tree. Its filename is > nommu-remove-__gfp_highmem-in-vmalloc-vzalloc-checkpatch-fixes.patch > > This patch should soon appear at > https://ozlabs.org/~akpm/mmots/broken-out/nommu-remove-__gfp_highmem-in-vmalloc-vzalloc-checkpatch-fixes.patch > and later at > https://ozlabs.org/~akpm/mmotm/broken-out/nommu-remove-__gfp_highmem-in-vmalloc-vzalloc-checkpatch-fixes.patch > > Before you just go and hit "reply", please: > a) Consider who else should be cc'ed > b) Prefer to cc a suitable mailing list as well > c) Ideally: find the original patch on the mailing list and do a > reply-to-all to that, adding suitable additional cc's > > *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** > > The -mm tree is included into linux-next and is updated > there every 3-4 working days > > ------------------------------------------------------ > From: Andrew Morton > Subject: nommu-remove-__gfp_highmem-in-vmalloc-vzalloc-checkpatch-fixes > > Cc: Chen Li > > WARNING: please, no spaces at the start of a line > #37: FILE: mm/nommu.c:226: > + return __vmalloc(size, GFP_KERNEL);$ > > total: 0 errors, 1 warnings, 16 lines checked > > NOTE: For some of the reported defects, checkpatch may be able to > mechanically convert to the typical style using --fix or --fix-inplace. > > ./patches/nommu-remove-__gfp_highmem-in-vmalloc-vzalloc.patch has style problems, please review. > > NOTE: If any of the errors are false positives, please report > them to the maintainer, see CHECKPATCH in MAINTAINERS. > > Please run checkpatch prior to sending patches > > Cc: Chen Li > Signed-off-by: Andrew Morton > --- > > mm/nommu.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > --- a/mm/nommu.c~nommu-remove-__gfp_highmem-in-vmalloc-vzalloc-checkpatch-fixes > +++ a/mm/nommu.c > @@ -223,7 +223,7 @@ long vread(char *buf, char *addr, unsign > */ > void *vmalloc(unsigned long size) > { > - return __vmalloc(size, GFP_KERNEL); > + return __vmalloc(size, GFP_KERNEL); > } > EXPORT_SYMBOL(vmalloc); > > _ > > Patches currently in -mm which might be from akpm@linux-foundation.org are > > mm.patch > mm-gup-pack-has_pinned-in-mmf_has_pinned-checkpatch-fixes.patch > mm-memcg-optimize-user-context-object-stock-access-checkpatch-fixes.patch > nommu-remove-__gfp_highmem-in-vmalloc-vzalloc-checkpatch-fixes.patch > linux-next-git-rejects.patch > kernel-forkc-export-kernel_thread-to-modules.patch > > > From mm/nommu.c: void *__vmalloc(unsigned long size, gfp_t gfp_mask) { /* * You can't specify __GFP_HIGHMEM with kmalloc() since kmalloc() * returns only a logical address. */ return kmalloc(size, (gfp_mask | __GFP_COMP) & ~__GFP_HIGHMEM); } __vmalloc just elimitate __GFP_HIGHMEM, so it makes no sense to add __GFP_HIGHMEM for nommu's vmalloc/vzalloc. changelog: *v2: Also fix a space style warning reported from checkpatch, which is introduced via commit 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Chen Li Reviewed-by: Matthew Wilcox (Oracle) Reviewed-by: David Hildenbrand --- mm/nommu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/nommu.c b/mm/nommu.c index 5c9ab799c0e6..f1794e818348 100644 --- a/mm/nommu.c +++ b/mm/nommu.c @@ -233,7 +233,7 @@ long vwrite(char *buf, char *addr, unsigned long count) */ void *vmalloc(unsigned long size) { - return __vmalloc(size, GFP_KERNEL | __GFP_HIGHMEM); + return __vmalloc(size, GFP_KERNEL); } EXPORT_SYMBOL(vmalloc); @@ -251,7 +251,7 @@ EXPORT_SYMBOL(vmalloc); */ void *vzalloc(unsigned long size) { - return __vmalloc(size, GFP_KERNEL | __GFP_HIGHMEM | __GFP_ZERO); + return __vmalloc(size, GFP_KERNEL | __GFP_ZERO); } EXPORT_SYMBOL(vzalloc);