Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1388638pxk; Mon, 31 Aug 2020 18:48:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw0vGIpq8IWMu2oAI1VNTHMjmwXBYsnBv0JAh0B+Le7N7VXYvI0HB4w4F4xeI7Yz6tt8dJK X-Received: by 2002:a17:906:d206:: with SMTP id w6mr3604761ejz.428.1598924929524; Mon, 31 Aug 2020 18:48:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598924929; cv=none; d=google.com; s=arc-20160816; b=HL/xImfkffeeoI+PhwMbWNZhTUfK8Kt2rPlIxYfK4WhKp1mwm6jcfxkryPRNs7FIRe 5rpSLFSek1SqOXD2AePiJkUKk0BcHilhIT2E5ffY3ClS1mX/ARDV2d6n76rCeVdlE021 XmmW/NARZfdjac/tQA1636ZU3VYejA3eQmZOnoZIARWD4I0HZIHJhNkdQIERqezRPR7/ 0bbWCJVNn0yhafeum/A6e8W6N48RC/qvqqMzh81/A+2YZRf3PjDMEeQ5Dob4KZM/842+ JMcjS0OF0iu4xGqv8jrrONXV3L5O3AK8xjlYqIzGURhCeBmAttpisq+eqh90yAu8RLBj mYAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=w/rKdrLrk4zskBoKRbshYviejQkiV3aqz8BDcJvIxA4=; b=NlnLEDePrl7yj7iaOMseKaelDzUnsiBuM30uj2+s/qXEA6vItayojIJtqtnfxgenaO wglITIZ12K1fRtLjyEUq+UDCozaFtOvaHrApvmZcHT7yLhgXxhHLNA8T2PJR/RnBYYfe SIuYz5Nj37tCmAhk4WDle1+CsU/VI3esh2HAnvg+ZV7BDpU77z1fMV/7rg6sQ8vkqcgW rTh0oWllDWftrzDvH4sMD6gq0ZgrnO+PGF5o//fKfDOvuSNjQeQjMNBW58LueWPfvCmT YwQWiY90gCJfsECVfrPku8igoxX/gzjwQUPmiYWXL651zkWg/F+eNM/vyW3T9zXi6wGa HqeQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b5si6491229eju.541.2020.08.31.18.48.27; Mon, 31 Aug 2020 18:48:49 -0700 (PDT) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726586AbgIABq6 (ORCPT + 99 others); Mon, 31 Aug 2020 21:46:58 -0400 Received: from out4436.biz.mail.alibaba.com ([47.88.44.36]:52808 "EHLO out4436.biz.mail.alibaba.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726224AbgIABq6 (ORCPT ); Mon, 31 Aug 2020 21:46:58 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R191e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e01358;MF=richard.weiyang@linux.alibaba.com;NM=1;PH=DS;RN=6;SR=0;TI=SMTPD_---0U7Txib9_1598924805; Received: from localhost(mailfrom:richard.weiyang@linux.alibaba.com fp:SMTPD_---0U7Txib9_1598924805) by smtp.aliyun-inc.com(127.0.0.1); Tue, 01 Sep 2020 09:46:46 +0800 From: Wei Yang To: mike.kravetz@oracle.com, akpm@linux-foundation.org Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, bhe@redhat.com, Wei Yang Subject: [Patch v4 6/7] mm/hugetlb: narrow the hugetlb_lock protection area during preparing huge page Date: Tue, 1 Sep 2020 09:46:35 +0800 Message-Id: <20200901014636.29737-7-richard.weiyang@linux.alibaba.com> X-Mailer: git-send-email 2.20.1 (Apple Git-117) In-Reply-To: <20200901014636.29737-1-richard.weiyang@linux.alibaba.com> References: <20200901014636.29737-1-richard.weiyang@linux.alibaba.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 c9b292e664c4..7b3357c1dcec 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -1493,9 +1493,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); -- 2.20.1 (Apple Git-117)