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=-3.5 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no 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 7F2E0C433DF for ; Sat, 4 Jul 2020 13:33:52 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 344A0208D5 for ; Sat, 4 Jul 2020 13:33:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="P6cgPErm" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 344A0208D5 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id B45B48D0065; Sat, 4 Jul 2020 09:33:51 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AF63B8D0035; Sat, 4 Jul 2020 09:33:51 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9E3E48D0065; Sat, 4 Jul 2020 09:33:51 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0027.hostedemail.com [216.40.44.27]) by kanga.kvack.org (Postfix) with ESMTP id 84A858D0035 for ; Sat, 4 Jul 2020 09:33:51 -0400 (EDT) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 0D9581EFF for ; Sat, 4 Jul 2020 13:33:51 +0000 (UTC) X-FDA: 77000486262.13.chess88_4f0577f26e9a Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin13.hostedemail.com (Postfix) with ESMTP id E59AD18140B72 for ; Sat, 4 Jul 2020 13:33:50 +0000 (UTC) X-HE-Tag: chess88_4f0577f26e9a X-Filterd-Recvd-Size: 3623 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf08.hostedemail.com (Postfix) with ESMTP for ; Sat, 4 Jul 2020 13:33:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Transfer-Encoding: Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To:Content-ID:Content-Description; bh=WX43RKw0+FGdp9bNmImS/2sAa8MNXnNJwwbZw51kMdQ=; b=P6cgPErml8i03xIAD2T2msZxIG m8LjhA4KE1VmUJ/jww8W5OIDqMwXNvGXmLJGm4V84vgiHw1Q1sLRBY/KET+hmBWm6YagHqDZOxy1S 1Cl5YP8V6suzo6wGWC78gJS46MGJpjwrQBxUv7MUsIRJcX5aG7Y+vlV7q/wTWzQA54upC4dU6oywQ vNfwjiOvGOpXyTBDyxyFo9KCpqLv4grXWw6HZGrK8fRYYgmfV9wk7OjDtMPRq144R4RlYp+6bxG0r b8KTCgPZUJhUs9VACBdSKb2OCv3N6WdQNjMqc6ky2TBcBYCmQnMTCLhZTAfd9qaKHaEari7D+2tOb do6pVwFg==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jriIM-0002wM-5j; Sat, 04 Jul 2020 13:33:30 +0000 Date: Sat, 4 Jul 2020 14:33:30 +0100 From: Matthew Wilcox To: Alex Shi 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 Subject: Re: [PATCH v14 15/20] mm/swap: serialize memcg changes during pagevec_lru_move_fn Message-ID: <20200704133330.GP25523@casper.infradead.org> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: E59AD18140B72 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: 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; > >> }; > >=20 > > pagevecs are used not just for LRU. If you want to use a list_head f= or > > LRU then define a new structure. >=20 > yes, there are much page don't use page->lru, like slab etc. we need a = new struct. That's not what I mean. Slab pages aren't on the LRU anyway. 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 than with an array.