Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp907054pxa; Thu, 27 Aug 2020 20:33:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzBmJmrLvHmsdQLVGdAAVJlVe40HBDI/3bnOmMus8dCfzqARPj+DYu6W3A4yNCRMpphMTeG X-Received: by 2002:a17:906:37c3:: with SMTP id o3mr25629306ejc.54.1598585635098; Thu, 27 Aug 2020 20:33:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598585635; cv=none; d=google.com; s=arc-20160816; b=jHRMULBHyzHr6mBk32xvMtkJf7t4VfvihiYDbrMtOSfKXLgaB3iCCRQyg+3I+Ar5bj Vo2DenqdyjvRzQO4RBDmGX1pYAr/Fei/Ilo/Z0Jn+njlhgGZ7tZvaccCtkpMA5eiPTJY mZ/xUIKFcJi67+fA/6G5lQfrk1JUhmJDRsfT2gIfq94ccjcVaHJJbITw+vdlQfx/6a0f jsOlXAY2u2YPkoTjVe4NYfh4utjCKVQOg34EpKw0Q6D98KZPt+eXU88GZBpDDDnQqE1f Y0sA3SZnxlVuJuQuusve63RqQrqX42Rtd2YEOCyFiadCpwpLCph8ds2nYeIp82dnHQ9N y8nw== 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=i/lAJpAjyDx3WETSCm2+Kyo4DSuZbSAgchiDiE68CBQ=; b=RGuZsZ81Hq8xRjwmS5me44wmmJV1a3iiee5O3jAMChmh3ff3o55+F2JcHjgmM4wtym bKqSahfUzZT4cI7hABOFXIK18LqwfTLiQS/s9EGfaFsgkOTnB6fO3s5YeZqdPbhfnIEB 78rpvgWf6ui4Mnw1QgHU2fEX8LKGRMRlQIkBl+iFR2UMb8dfki9MX5323fgCa0Y0oRch qYFKjgUX7TLw7HSB3t/62wqDeyWsTsWUteKAcZ3NlEQ5qFDTrupItSDmStfxGvTq0RxW YksL7SWKzkuwI8O/DcGv2z+f7BUyDXSN7tU8a6ygUIKmQFw/PQTDii7v7vb17oZfEaT5 mGWA== 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 u1si2591502eda.219.2020.08.27.20.33.32; Thu, 27 Aug 2020 20:33:55 -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 S1728281AbgH1Dc6 (ORCPT + 99 others); Thu, 27 Aug 2020 23:32:58 -0400 Received: from out30-130.freemail.mail.aliyun.com ([115.124.30.130]:40562 "EHLO out30-130.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728015AbgH1Dc6 (ORCPT ); Thu, 27 Aug 2020 23:32:58 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R161e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04407;MF=richard.weiyang@linux.alibaba.com;NM=1;PH=DS;RN=6;SR=0;TI=SMTPD_---0U736V23_1598585574; Received: from localhost(mailfrom:richard.weiyang@linux.alibaba.com fp:SMTPD_---0U736V23_1598585574) by smtp.aliyun-inc.com(127.0.0.1); Fri, 28 Aug 2020 11:32:54 +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 v2 7/7] mm/hugetlb: narrow the hugetlb_lock protection area during preparing huge page Date: Fri, 28 Aug 2020 11:32:42 +0800 Message-Id: <20200828033242.8787-8-richard.weiyang@linux.alibaba.com> X-Mailer: git-send-email 2.20.1 (Apple Git-117) In-Reply-To: <20200828033242.8787-1-richard.weiyang@linux.alibaba.com> References: <20200828033242.8787-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 6ad365dd1e96..ae840dc09197 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -1492,9 +1492,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)