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=-5.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,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 389E5C433E0 for ; Sat, 4 Jul 2020 15:47:47 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D4E3F207D4 for ; Sat, 4 Jul 2020 15:47:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D4E3F207D4 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 2395F8D0035; Sat, 4 Jul 2020 11:47:46 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1E9E38D0030; Sat, 4 Jul 2020 11:47:46 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0D8EA8D0035; Sat, 4 Jul 2020 11:47:46 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0088.hostedemail.com [216.40.44.88]) by kanga.kvack.org (Postfix) with ESMTP id ED4308D0030 for ; Sat, 4 Jul 2020 11:47:45 -0400 (EDT) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 731B4180AD804 for ; Sat, 4 Jul 2020 15:47:45 +0000 (UTC) X-FDA: 77000823690.13.wall70_39099dd26e9b Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin13.hostedemail.com (Postfix) with ESMTP id 49CD518140B72 for ; Sat, 4 Jul 2020 15:47:45 +0000 (UTC) X-HE-Tag: wall70_39099dd26e9b X-Filterd-Recvd-Size: 3831 Received: from out30-132.freemail.mail.aliyun.com (out30-132.freemail.mail.aliyun.com [115.124.30.132]) by imf25.hostedemail.com (Postfix) with ESMTP for ; Sat, 4 Jul 2020 15:47:43 +0000 (UTC) X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R381e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04357;MF=alex.shi@linux.alibaba.com;NM=1;PH=DS;RN=17;SR=0;TI=SMTPD_---0U1ffIy7_1593877655; Received: from IT-FVFX43SYHV2H.lan(mailfrom:alex.shi@linux.alibaba.com fp:SMTPD_---0U1ffIy7_1593877655) by smtp.aliyun-inc.com(127.0.0.1); Sat, 04 Jul 2020 23:47:36 +0800 Subject: Re: [PATCH v14 15/20] mm/swap: serialize memcg changes during pagevec_lru_move_fn To: Matthew Wilcox Cc: Konstantin Khlebnikov , Andrew Morton , Mel Gorman , Tejun Heo , Hugh Dickins , =?UTF-8?B?0JrQvtC90YHRgtCw0L3RgtC40L0g0KXQu9C10LHQvdC40LrQvtCy?= , daniel.m.jordan@oracle.com, yang.shi@linux.alibaba.com, Johannes Weiner , lkp@intel.com, linux-mm@kvack.org, Linux Kernel Mailing List , Cgroups , shakeelb@google.com, Joonsoo Kim , richard.weiyang@gmail.com References: <1593752873-4493-1-git-send-email-alex.shi@linux.alibaba.com> <1593752873-4493-16-git-send-email-alex.shi@linux.alibaba.com> <56e395c6-81e7-7163-0d4f-42b91573289f@linux.alibaba.com> <20200704113944.GN25523@casper.infradead.org> <20200704133330.GP25523@casper.infradead.org> From: Alex Shi Message-ID: <4a42888e-4d7e-0d76-358c-9a073e6e4794@linux.alibaba.com> Date: Sat, 4 Jul 2020 23:47:11 +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: <20200704133330.GP25523@casper.infradead.org> Content-Type: text/plain; charset=utf-8 X-Rspamd-Queue-Id: 49CD518140B72 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam02 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/7/4 =E4=B8=8B=E5=8D=889:33, Matthew Wilcox =E5=86=99=E9=81= =93: > On Sat, Jul 04, 2020 at 09:12:46PM +0800, Alex Shi wrote: >> =E5=9C=A8 2020/7/4 =E4=B8=8B=E5=8D=887:39, Matthew Wilcox =E5=86=99=E9= =81=93: >>> On Sat, Jul 04, 2020 at 07:34:59PM +0800, Alex Shi wrote: >>>> That's a great idea! Guess what the new struct we need would be like= this? >>>> I like to try this. :) >>>> >>>> >>>> diff --git a/include/linux/pagevec.h b/include/linux/pagevec.h >>>> index 081d934eda64..d62778c8c184 100644 >>>> --- a/include/linux/pagevec.h >>>> +++ b/include/linux/pagevec.h >>>> @@ -20,7 +20,7 @@ >>>> struct pagevec { >>>> unsigned char nr; >>>> bool percpu_pvec_drained; >>>> - struct page *pages[PAGEVEC_SIZE]; >>>> + struct list_head veclist; >>>> }; >>> >>> pagevecs are used not just for LRU. If you want to use a list_head f= or >>> LRU then define a new structure. >> >> yes, there are much page don't use page->lru, like slab etc. we need a= new struct>=20 > That's not what I mean. Slab pages aren't on the LRU anyway. Right. I mean, that's reason for a new struct if we change to list. >=20 > Consider the callers of page_cache_delete_batch(). These use a pagevec > for a non-LRU purpose, and they will be much slower with a list_head th= an > with an array. >=20 Thanks for the info. If the list is slower than pagevec, maybe it's not worth to do the change= . Since pagevec could handle any kind of pages, anon/file, non-active/activ= e, but one list only fit for just one kind of list. 5 kinds of list adding would inc= rease the complexity. Consider this, I am wondering if it's worth? Thanks Alex