Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp677039pxk; Sun, 30 Aug 2020 19:25:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzd7MGsGsWbFDsfsT8Zz7Qc2MdtJMkDByiQP35HjvYZoaYKhqH8XCtCi4L0xpbDxbhMec9o X-Received: by 2002:a17:906:b086:: with SMTP id x6mr10437048ejy.204.1598840718523; Sun, 30 Aug 2020 19:25:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598840718; cv=none; d=google.com; s=arc-20160816; b=RWXOyYbnDc48MhVH2cko44qXnBcIAD1lK2mDrd0XJFvGsPL1689zrhua6mkAZelULR gYYw0PuKT9tUq6d4G0UyX9S1o4VNJiYEHgPgO2QEWhtThF0pcgYJkC4Kp6blquCkxHaA eeor+HuBCR314aUjBOAyACOSk/br3hIBKvhN7Hp13Jqn+oHSzH9JU1K9l65pTXeQND+j /xs6a6Zhu0L/b+319gfSk2RHqsYMyPA96qExMn1qDfL79VDWShHCauS61tCx1XrzBPqo 71VRAZNVEaV6OArIps0LKY3bo+j8Sg9Pw4B1KKwQMygB60uWSpIq+3TTSrXjDjpxVThv lKxA== 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=Sqg9irBTnvz/3Bc2dEFE+SjOetZvDYcVYmFBuh4mZYBJTRZB9wOJmLBykj8cewi9Et jU3rB5Z9XBfd5mGWOzLTVrhKhJgRKJLX5ygEkikQQAivI5zdmZcX56YXypf1RnCs6MZK jvoG03Hb+pWhgW+/jwctqMaE0o9VNRtMRvS7Ffx/IQdrHRC7RquT1nr+wnM0fPYzLyIs 8c/5r4ksVJZ3TD2oqtev3JQOx4NduXkmoC72FATKUqIoK6wJZTl+wiZUk9o/L+xCis9J 31nWr+KNIlk/h/9HFmfMe+jb2/6F7Jot9YmdY0oD6S8pQMycqTnWPtkRz27/3IZ3SyJH cp+g== 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 v19si4179257edx.448.2020.08.30.19.24.56; Sun, 30 Aug 2020 19:25:18 -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 S1727111AbgHaCYI (ORCPT + 99 others); Sun, 30 Aug 2020 22:24:08 -0400 Received: from out30-131.freemail.mail.aliyun.com ([115.124.30.131]:54257 "EHLO out30-131.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727043AbgHaCYE (ORCPT ); Sun, 30 Aug 2020 22:24:04 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R141e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01f04392;MF=richard.weiyang@linux.alibaba.com;NM=1;PH=DS;RN=6;SR=0;TI=SMTPD_---0U7IrQYJ_1598840640; Received: from localhost(mailfrom:richard.weiyang@linux.alibaba.com fp:SMTPD_---0U7IrQYJ_1598840640) by smtp.aliyun-inc.com(127.0.0.1); Mon, 31 Aug 2020 10:24:00 +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 v3 6/7] mm/hugetlb: narrow the hugetlb_lock protection area during preparing huge page Date: Mon, 31 Aug 2020 10:23:50 +0800 Message-Id: <20200831022351.20916-7-richard.weiyang@linux.alibaba.com> X-Mailer: git-send-email 2.20.1 (Apple Git-117) In-Reply-To: <20200831022351.20916-1-richard.weiyang@linux.alibaba.com> References: <20200831022351.20916-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)