Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp188379pxa; Tue, 4 Aug 2020 03:05:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy04pOjB7HejxcDNZDUp6ps0i5qRudLNRQnE5AGJdmS6PB1XdngIWOLxZnPoTvkbklQMZyj X-Received: by 2002:aa7:cb15:: with SMTP id s21mr20317704edt.175.1596535554508; Tue, 04 Aug 2020 03:05:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596535554; cv=none; d=google.com; s=arc-20160816; b=Utj0yXVz4xHiiMNxOsg3cOfLNy+/Z+reu0m/jIn4wMmRLS2K4dK4D67LLBn9731B9d X37wRVbo3JEIIsqNtFT0Y5G91ssigSU2+YT2erKYbzLeiJyW7RicJzs1XFEMwJMa7pxE gI8VNNWjfIYc36eHBClEXV/ODd0xIqDOouwZC3El6NZQV+L+XCBi7NmPB5veSlRwf1gJ L2sjwF5LaPZ2BJZ/AK2T8tn8hTeHf84i/Cy6qzN/ZUClvzSP4GUGVoOxSE8IvMF8bOp+ Bh8kqYPJiI/0Uiuhn84w/JcdkWzKYHZyuNm8Ky4SCMmIXT0l34gdGqjtLqNaXEBRQv8C 2i+A== 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:in-reply-to :mime-version:user-agent:date:message-id:from:references:cc:to :subject; bh=g8/Kni08CHzFikemQCULekIVNUS9LiIoax1fm0CqJaQ=; b=deMnOz8pgpvvrOcQQKM5+pBAVb6cBxH5B4ZTySe/rshv21iqS19ZUYYJa796/s1wSr CIz2hinZkS8q5EbLYd33O4n+x/S+RaGCironXD7fujV4qgYb0N3022EYwVdicklgTTiB Qz4Z2VKtL4tRD9T4dLAodvpOcupq9kuAL750qx1HnVR2YEe1uHIAHJH25SLBi76jg4hb J7bRZXcOEMzb1yc7zWz6t0Lw+2ENTpeAb7bVzDjRRWJlWcPFIyKbFKOBQZSl2NgP+VAz vIOhbkH8pv6WcPTCfTZ53Ybkl67Cl7S5Q3yFxCbLKD4FlMTZvIGjfKXyOknxDpgKHUIV 91Gg== 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 bj23si4420330ejb.94.2020.08.04.03.05.32; Tue, 04 Aug 2020 03:05:54 -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 S1730031AbgHDKE6 (ORCPT + 99 others); Tue, 4 Aug 2020 06:04:58 -0400 Received: from out30-56.freemail.mail.aliyun.com ([115.124.30.56]:54201 "EHLO out30-56.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728332AbgHDKE5 (ORCPT ); Tue, 4 Aug 2020 06:04:57 -0400 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 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 在 2020/8/4 上午6:37, Alexander Duyck 写道: >> >> shrink_inactive_list() also diverts any unevictable pages that it finds 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 SHM_LOCK'd >> after shrink_active_list() had moved them to the inactive list, or pages mapped > Same here. lruvec is used per memcg per node actually, and it fallback to node if memcg disabled. So the comments are still right. And most of changes just fix from zone->lru_lock to pgdat->lru_lock change. > >> 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 protected by >> - * pgdat->lru_lock. Sometimes used as a generic list >> + * lruvec->lru_lock. Sometimes used as a generic 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_area *area, int migratetype) >> struct pglist_data; >> >> /* >> - * zone->lock and the zone lru_lock are two of the hottest locks in the kernel. >> + * zone->lock and the lru_lock are two of the hottest locks in the kernel. >> * 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. > 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 kernel. - * So add a wild amount of padding here to ensure that they fall into separate + * Add a wild amount of padding here to ensure datas fall into separate * cachelines. There are very few zone structures in the machine, so space * consumption is not a concern here. */ Thanks! Alex