Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp995886pxu; Wed, 16 Dec 2020 22:31:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJzComrk0OryOSfH5i2ocuJYxAqPOARZnbbTpo4TBh2igbCWoHTBouSrqdLtB4E5440ASUKs X-Received: by 2002:a50:d757:: with SMTP id i23mr37340935edj.116.1608186679855; Wed, 16 Dec 2020 22:31:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608186679; cv=none; d=google.com; s=arc-20160816; b=x7Qhkn8h86zaX/bUwuVuHPL+Q2kXYJAfx1l4iLeScVSRjQpG37jVqd5RdM3nImT6ak DUEIQtxKk2KaDr1uNTWhDCtvProh1ZnrIRlLQ0uv+uiajZPOLQQaiUqTTjogMQil9cuY nN+2d1lPWwePRdL4a0tOn2kZup2IRS3bityOY2lfFEujT5qMm+NVa9kJc9vnqrMx1BIm juuFgRM4tt/SaSCINPyDuPBGPXHX46lnwmx9Hor2LKQLWd8wzcVdr+YZvRex9VKUYRZO MQm2JgA187KuYZPEGqGLh1EGAOS+JGdiQ/P0+/cZYtQUEUaCDq9xKJHNqvPkIwcT2/bB 0BRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from; bh=2ITL53CttWOm/OjPlON9oa6WJ7FYwN+3Iiy3yoJOja0=; b=Gv887LvpNLDZ6kIGPX3q2paN4os27xbSkTzHqzPr5cAIEUkf5c/pPo/I26VCNDypOQ yaRtl4h8akeuMIdubrdrs/s92pirHNYrY28JURg4fWSBkMqZ551nuWKPkVLZijZEwfqy Sx2hGNUMpTYfPt41L89CjkrCls1NB/eEYq25PD1FH1fecHfTejzczxQ4ROCsJXK9QkdD BMPlgHqzA7lowJl3OsVhiQ3zBlbcsMMNktaVNOUx9Io7Vs4Dgk6DamTPBN14pxNgPH7e 1V+iy4kB2ufrexOSFJr94yppepLhS1qQu6+pnRXQU/dZs2xIuhYMaNYpx2CelMXXeNt+ DXbA== 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 z23si313705edr.334.2020.12.16.22.30.57; Wed, 16 Dec 2020 22:31:19 -0800 (PST) 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 S1727145AbgLQG3s (ORCPT + 99 others); Thu, 17 Dec 2020 01:29:48 -0500 Received: from out4436.biz.mail.alibaba.com ([47.88.44.36]:10569 "EHLO out4436.biz.mail.alibaba.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726862AbgLQG3s (ORCPT ); Thu, 17 Dec 2020 01:29:48 -0500 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R131e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04426;MF=alex.shi@linux.alibaba.com;NM=1;PH=DS;RN=5;SR=0;TI=SMTPD_---0UItliQ7_1608186540; Received: from aliy80.localdomain(mailfrom:alex.shi@linux.alibaba.com fp:SMTPD_---0UItliQ7_1608186540) by smtp.aliyun-inc.com(127.0.0.1); Thu, 17 Dec 2020 14:29:01 +0800 From: Alex Shi To: akpm@linux-foundation.org Cc: Hugh Dickins , Johannes Weiner , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/3] mm/compaction: remove rcu_read_lock during page compaction Date: Thu, 17 Dec 2020 14:28:52 +0800 Message-Id: <1608186532-81218-3-git-send-email-alex.shi@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1608186532-81218-1-git-send-email-alex.shi@linux.alibaba.com> References: <1608186532-81218-1-git-send-email-alex.shi@linux.alibaba.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org rcu_read_lock was used to guard memcg destory, now TestClearPageLRU could block this happen, so we don't need it. Remove it to reduce locking load in debugging mode. Signed-off-by: Alex Shi Cc: Hugh Dickins Cc: Johannes Weiner Cc: Andrew Morton Cc: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org --- mm/compaction.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/mm/compaction.c b/mm/compaction.c index 8049d3530812..02af220fb992 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -995,7 +995,6 @@ isolate_migratepages_block(struct compact_control *cc, unsigned long low_pfn, if (!TestClearPageLRU(page)) goto isolate_fail_put; - rcu_read_lock(); lruvec = mem_cgroup_page_lruvec(page, pgdat); /* If we already hold the lock, we can skip some rechecking */ @@ -1005,7 +1004,6 @@ isolate_migratepages_block(struct compact_control *cc, unsigned long low_pfn, compact_lock_irqsave(&lruvec->lru_lock, &flags, cc); locked = lruvec; - rcu_read_unlock(); lruvec_memcg_debug(lruvec, page); @@ -1026,8 +1024,7 @@ isolate_migratepages_block(struct compact_control *cc, unsigned long low_pfn, SetPageLRU(page); goto isolate_fail_put; } - } else - rcu_read_unlock(); + } /* The whole page is taken off the LRU; skip the tail pages. */ if (PageCompound(page)) -- 2.29.GIT