Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2070227pxa; Fri, 7 Aug 2020 02:15:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxZRDitmQ9+Gpc8UpBHTf704vPfJYiWBRNibXMT/Ge7o7VNdJtAeUVdu8v7qFo4LOflk9EK X-Received: by 2002:a50:fd0b:: with SMTP id i11mr1113815eds.298.1596791725801; Fri, 07 Aug 2020 02:15:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596791725; cv=none; d=google.com; s=arc-20160816; b=ew+G7t3Xqy/uT2c348G72kOsnvB1sbmZnfNhXm8p39xjaD9xMKU6Xv9oyfGHwGDlR9 sLJ0/Avwaq2pKqbV51EIBa0n5NEn2NhOwVTW+nsf0GlC57yTiOk6gRREb2mAVRI1Fvmh CIm8c2SYAEsx8Fz9OsqdEuuIj9InCxt3LzJUKzYj179+xQhzXUCbaB5/CoEq1pJ6jFzC bgQzfcT+zw51+wnRlmLuJ9anQ75BPAPZ/zy1A4d0YlhMrYfZiPy7V8bF4+ZRdMkTqs0+ kc1O8ypx7YmxurQisQ5OgIP6bzrDUt6OHDWCeNIUTE3rUzZfT0HucqbFcJLWEEPYd0eD S0jA== 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=+XsmWKD221oT4pfkN+QoPWfFsJhrxXTMKVto2yoylLw=; b=VZzpztuHcH3H3yqLngKYSunwowu9lHEmLP4fO4CtagiuCQnVBnm8ZNcRgIr1rSWVCT S9PToTvBLMSVRYZqYSqxYLmDrOjAvSIAXoGvJ145x5EU77WZpOQSnxox7UD3Zzvq/cMp F2PUa02X25xK2I/P1nXl1uX+qI66un9KfbAeGD5VX05pm50HiKsDE2Gm+Eb/fWEvrIUK LNBXG2eM3VQXJTieSFPIRD8Y9Wl/QoFxIwyilAXGF+aIVqb6Rn8wDvsQK8srW0sHyksJ i+wOtE4Nr1UFEf+BvW+6e7wzXbZ9dzR8SGXjnoT6rtgJUaQ8/M4ss4fG7hA7LQmaUAl0 bz3Q== 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 o17si4963397ejg.156.2020.08.07.02.15.03; Fri, 07 Aug 2020 02:15:25 -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 S1728003AbgHGJN0 (ORCPT + 99 others); Fri, 7 Aug 2020 05:13:26 -0400 Received: from out30-45.freemail.mail.aliyun.com ([115.124.30.45]:49075 "EHLO out30-45.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727897AbgHGJNX (ORCPT ); Fri, 7 Aug 2020 05:13:23 -0400 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 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 --- 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); -- 2.20.1 (Apple Git-117)