From patchwork Fri Aug 7 09:12:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yang X-Patchwork-Id: 11705201 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5614D722 for ; Fri, 7 Aug 2020 09:13:38 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 26C2D22D00 for ; Fri, 7 Aug 2020 09:13:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 26C2D22D00 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 36BAC8D0098; Fri, 7 Aug 2020 05:13:29 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 31C8C8D0097; Fri, 7 Aug 2020 05:13:29 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 20C8C8D0098; Fri, 7 Aug 2020 05:13:29 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0008.hostedemail.com [216.40.44.8]) by kanga.kvack.org (Postfix) with ESMTP id ECAAB8D0097 for ; Fri, 7 Aug 2020 05:13:28 -0400 (EDT) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id B1B58181AEF00 for ; Fri, 7 Aug 2020 09:13:28 +0000 (UTC) X-FDA: 77123209296.30.chess69_5a0f36226fbf Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin30.hostedemail.com (Postfix) with ESMTP id 88069180B3C83 for ; Fri, 7 Aug 2020 09:13:28 +0000 (UTC) X-Spam-Summary: 1,0,0,9cdeb114d7c41da4,d41d8cd98f00b204,richard.weiyang@linux.alibaba.com,,RULES_HIT:41:355:379:541:960:973:988:989:1260:1261:1311:1314:1345:1359:1437:1515:1534:1540:1568:1711:1714:1730:1747:1777:1792:2393:2559:2562:3138:3139:3140:3141:3142:3867:3871:5007:6261:7903:10004:11026:11473:11658:11914:12043:12296:12297:12438:12555:12895:13069:13255:13311:13357:13894:14181:14384:14394:14721:21080:21627:30054:30065,0,RBL:115.124.30.42:@linux.alibaba.com:.lbl8.mailshell.net-64.201.201.201 62.20.2.100;04yrfns45jbk9mo1et7pox4a4ba4gyc318ay1g5wesnrf3rzko5g8t7w78eq6sp.apjqdhfzp477wm9jo7ro9gmwk7akt4gcx4iyihwe5jdgtc5yr5nubeagmuk9j6r.g-lbl8.mailshell.net-223.238.255.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:25,LUA_SUMMARY:none X-HE-Tag: chess69_5a0f36226fbf X-Filterd-Recvd-Size: 2137 Received: from out30-42.freemail.mail.aliyun.com (out30-42.freemail.mail.aliyun.com [115.124.30.42]) by imf40.hostedemail.com (Postfix) with ESMTP for ; Fri, 7 Aug 2020 09:13:27 +0000 (UTC) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R151e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04357;MF=richard.weiyang@linux.alibaba.com;NM=1;PH=DS;RN=5;SR=0;TI=SMTPD_---0U5.Byfr_1596791600; Received: from localhost(mailfrom:richard.weiyang@linux.alibaba.com fp:SMTPD_---0U5.Byfr_1596791600) by smtp.aliyun-inc.com(127.0.0.1); Fri, 07 Aug 2020 17:13:20 +0800 From: Wei Yang To: mike.kravetz@oracle.com, akpm@linux-foundation.org Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Wei Yang Subject: [PATCH 09/10] mm/hugetlb: narrow the hugetlb_lock protection area during preparing huge page Date: Fri, 7 Aug 2020 17:12:50 +0800 Message-Id: <20200807091251.12129-10-richard.weiyang@linux.alibaba.com> X-Mailer: git-send-email 2.20.1 (Apple Git-117) In-Reply-To: <20200807091251.12129-1-richard.weiyang@linux.alibaba.com> References: <20200807091251.12129-1-richard.weiyang@linux.alibaba.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: 88069180B3C83 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam03 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000097, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: set_hugetlb_cgroup_[rsvd] just manipulate page local data, which is not necessary to be protected by hugetlb_lock. Let's take this out. Signed-off-by: Wei Yang Reviewed-by: Baoquan He Reviewed-by: Mike Kravetz --- mm/hugetlb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 9473eb6800e9..1f2010c9dd8d 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -1494,9 +1494,9 @@ static void prep_new_huge_page(struct hstate *h, struct page *page, int nid) { INIT_LIST_HEAD(&page->lru); set_compound_page_dtor(page, HUGETLB_PAGE_DTOR); - spin_lock(&hugetlb_lock); set_hugetlb_cgroup(page, NULL); set_hugetlb_cgroup_rsvd(page, NULL); + spin_lock(&hugetlb_lock); h->nr_huge_pages++; h->nr_huge_pages_node[nid]++; spin_unlock(&hugetlb_lock);