Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp918311pxb; Thu, 5 Nov 2020 17:15:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJzXFVWhBvUaiiKqVKj4Wmwo/CJ7FALVBUEnWiaT8K865HVIMmehdTjiFUCZkgh91zKbblws X-Received: by 2002:a05:6402:206:: with SMTP id t6mr5473323edv.291.1604625320710; Thu, 05 Nov 2020 17:15:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604625320; cv=none; d=google.com; s=arc-20160816; b=upUUA2lhJYJRVlULXc1dbrTKmBZqVY0zhC7saRRH5W0ysKF+dUVjexD1mm25N4QA/D qTidY+eS6UskVPhdNrJdIO6W+uU0m7WjiGx8J03bw1LNM8xNCsOsigYdx7BQw1rqkCAR R+FFnY/CCO5GHOXtyI193UXs/J6QCqgC+HQ9LKpRvXVl0sSU1dx1ifL2ISOnQhxHPiSn aR5aWG0SlMk4AiL5sa/bi87gQX9lC0PuVmoP9NBLboYjyOq55UfZf5swazJqUmFXRlHG 8XToV40ap4Y3qWOeoiXP2TFVoSEWIZMRBHkprYyE16I2GaI8TBZF8+zvT1+nf9ofDf68 GnbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:references:cc:to :subject; bh=qu8lRzsuF7+4uOP2L3xPE7YL4oKrFG7m2xGxsGc46nU=; b=W5xEnJ8TSQ1Dxgp2q5LmQ40GIvbFx1wwoR2pqdPOmU9vQo4/muqE/oATwDFmjw5vn5 RxlXrGHidZgHGKFsUvcbnh9oLuQa5WpnG4yxl6n9xRl9ubyJWdlWgVo51YtODwcrFfmU xsUJ2i8hVLNZyrk+olCWjWn5LzdGcDMsCWPzLsgqzc7WHG92/9ZAGSWuuxKjgoj8UdbX eWHE0bjE6Jjy+E8lgZIP8jRPC3wmw+MnK7IH+YLgziPs668y7SLPKTEkqCFxZfIoQYdQ oVrXCypInDQxdv7YCvqg/zzkyJ0eXxtIBHckPkmyA996pEM1eP4B5afqnaYKx/x4uZT8 tUkA== 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 x5si2320145ejf.218.2020.11.05.17.14.58; Thu, 05 Nov 2020 17:15:20 -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 S1732946AbgKFBL3 (ORCPT + 99 others); Thu, 5 Nov 2020 20:11:29 -0500 Received: from out30-43.freemail.mail.aliyun.com ([115.124.30.43]:53250 "EHLO out30-43.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732396AbgKFBL2 (ORCPT ); Thu, 5 Nov 2020 20:11:28 -0500 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R211e4;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=23;SR=0;TI=SMTPD_---0UEMg2FE_1604625083; Received: from IT-FVFX43SYHV2H.local(mailfrom:alex.shi@linux.alibaba.com fp:SMTPD_---0UEMg2FE_1604625083) by smtp.aliyun-inc.com(127.0.0.1); Fri, 06 Nov 2020 09:11:24 +0800 Subject: Re: [PATCH v20 08/20] mm: page_idle_get_page() does not need lru_lock To: Johannes Weiner Cc: Matthew Wilcox , akpm@linux-foundation.org, mgorman@techsingularity.net, tj@kernel.org, hughd@google.com, khlebnikov@yandex-team.ru, daniel.m.jordan@oracle.com, lkp@intel.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, shakeelb@google.com, iamjoonsoo.kim@lge.com, richard.weiyang@gmail.com, kirill@shutemov.name, alexander.duyck@gmail.com, rong.a.chen@intel.com, mhocko@suse.com, vdavydov.dev@gmail.com, shy828301@gmail.com, Vlastimil Babka , Minchan Kim References: <1603968305-8026-1-git-send-email-alex.shi@linux.alibaba.com> <1603968305-8026-9-git-send-email-alex.shi@linux.alibaba.com> <20201102144110.GB724984@cmpxchg.org> <20201102144927.GN27442@casper.infradead.org> <20201102202003.GA740958@cmpxchg.org> <20201104174603.GB744831@cmpxchg.org> <6eea82d8-e406-06ee-2333-eb6e2f1944e5@linux.alibaba.com> <20201105045702.GI17076@casper.infradead.org> <1e8f0162-cf2e-03eb-e7e0-ccc9f6a3eaf2@linux.alibaba.com> <20201105153649.GC744831@cmpxchg.org> From: Alex Shi Message-ID: Date: Fri, 6 Nov 2020 09:11:12 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <20201105153649.GC744831@cmpxchg.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 在 2020/11/5 下午11:36, Johannes Weiner 写道: >>> */ >>> > Yeah, I don't think this scenario warrants the full race diagram in > the code itself. > > But the code is highly specific - synchronizing one struct page member > for one particular use case. Let's keep at least a reference to what > we are synchronizing against. There is a non-zero chance that if the > comment goes out of date, so does the code. How about this? > > /* > * page_idle does a lockless/optimistic rmap scan on page->mapping. > * Make sure the compiler doesn't split the stores of anon_vma and > * the PAGE_MAPPING_ANON type identifier, otherwise the rmap code > * could mistake the mapping for a struct address_space and crash. > */ Thanks a lot to you all. I will update to v21 patch Alex