From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.0 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A9674C433DF for ; Tue, 4 Aug 2020 10:05:11 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 9224D22B45 for ; Tue, 4 Aug 2020 10:05:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9224D22B45 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id F27CA8D0150; Tue, 4 Aug 2020 06:05:10 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id ED9B38D0081; Tue, 4 Aug 2020 06:05:10 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DEF4F8D0150; Tue, 4 Aug 2020 06:05:10 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0116.hostedemail.com [216.40.44.116]) by kanga.kvack.org (Postfix) with ESMTP id C9B768D0081 for ; Tue, 4 Aug 2020 06:05:10 -0400 (EDT) Received: from smtpin21.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 8AEDC180AD801 for ; Tue, 4 Aug 2020 10:05:10 +0000 (UTC) X-FDA: 77112453180.21.song11_0c0da2826fa5 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin21.hostedemail.com (Postfix) with ESMTP id 7AD62180445E4 for ; Tue, 4 Aug 2020 10:05:01 +0000 (UTC) X-HE-Tag: song11_0c0da2826fa5 X-Filterd-Recvd-Size: 5363 Received: from out30-56.freemail.mail.aliyun.com (out30-56.freemail.mail.aliyun.com [115.124.30.56]) by imf02.hostedemail.com (Postfix) with ESMTP for ; Tue, 4 Aug 2020 10:04:59 +0000 (UTC) X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R101e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e07488;MF=alex.shi@linux.alibaba.com;NM=1;PH=DS;RN=21;SR=0;TI=SMTPD_---0U4jkImR_1596535490; Received: from IT-FVFX43SYHV2H.local(mailfrom:alex.shi@linux.alibaba.com fp:SMTPD_---0U4jkImR_1596535490) by smtp.aliyun-inc.com(127.0.0.1); Tue, 04 Aug 2020 18:04:51 +0800 Subject: Re: [PATCH v17 21/21] mm/lru: revise the comments of lru_lock To: Alexander Duyck Cc: Andrew Morton , Mel Gorman , Tejun Heo , Hugh Dickins , Konstantin Khlebnikov , Daniel Jordan , Yang Shi , Matthew Wilcox , Johannes Weiner , kbuild test robot , linux-mm , LKML , cgroups@vger.kernel.org, Shakeel Butt , Joonsoo Kim , Wei Yang , "Kirill A. Shutemov" , Rong Chen , Andrey Ryabinin , Jann Horn References: <1595681998-19193-1-git-send-email-alex.shi@linux.alibaba.com> <1595681998-19193-22-git-send-email-alex.shi@linux.alibaba.com> From: Alex Shi Message-ID: Date: Tue, 4 Aug 2020 18:04:34 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 X-Rspamd-Queue-Id: 7AD62180445E4 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam04 Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: =E5=9C=A8 2020/8/4 =E4=B8=8A=E5=8D=886:37, Alexander Duyck =E5=86=99=E9=81= =93: >> >> shrink_inactive_list() also diverts any unevictable pages that it fin= ds on the >> -inactive lists to the appropriate zone's unevictable list. >> +inactive lists to the appropriate node's unevictable list. >> >> shrink_inactive_list() should only see SHM_LOCK'd pages that became S= HM_LOCK'd >> after shrink_active_list() had moved them to the inactive list, or pa= ges mapped > Same here. lruvec is used per memcg per node actually, and it fallback to node if me= mcg disabled. So the comments are still right. And most of changes just fix from zone->lru_lock to pgdat->lru_lock chang= e. >=20 >> diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h >> index 64ede5f150dc..44738cdb5a55 100644 >> --- a/include/linux/mm_types.h >> +++ b/include/linux/mm_types.h >> @@ -78,7 +78,7 @@ struct page { >> struct { /* Page cache and anonymous pages */ >> /** >> * @lru: Pageout list, eg. active_list protect= ed by >> - * pgdat->lru_lock. Sometimes used as a gener= ic list >> + * lruvec->lru_lock. Sometimes used as a gene= ric list >> * by the page owner. >> */ >> struct list_head lru; >> diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h >> index 8af956aa13cf..c92289a4e14d 100644 >> --- a/include/linux/mmzone.h >> +++ b/include/linux/mmzone.h >> @@ -115,7 +115,7 @@ static inline bool free_area_empty(struct free_are= a *area, int migratetype) >> struct pglist_data; >> >> /* >> - * zone->lock and the zone lru_lock are two of the hottest locks in t= he kernel. >> + * zone->lock and the lru_lock are two of the hottest locks in the ke= rnel. >> * So add a wild amount of padding here to ensure that they fall into= separate >> * cachelines. There are very few zone structures in the machine, so= space >> * consumption is not a concern here. > So I don't believe you are using ZONE_PADDING in any way to try and > protect the LRU lock currently. At least you aren't using it in the > lruvec. As such it might make sense to just drop the reference to the > lru_lock here. That reminds me that we still need to review the > placement of the lru_lock and determine if there might be a better > placement and/or padding that might improve performance when under > heavy stress. >=20 Right, is it the following looks better? diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index ccc76590f823..0ed520954843 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h @@ -113,8 +113,7 @@ static inline bool free_area_empty(struct free_area *= area, int migratetype) struct pglist_data; /* - * zone->lock and the lru_lock are two of the hottest locks in the kerne= l. - * So add a wild amount of padding here to ensure that they fall into se= parate + * Add a wild amount of padding here to ensure datas fall into separate * cachelines. There are very few zone structures in the machine, so sp= ace * consumption is not a concern here. */ Thanks! Alex