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=-9.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS 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 725BBC433E3 for ; Tue, 18 Aug 2020 14:58:28 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 36664207DE for ; Tue, 18 Aug 2020 14:58:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="sObKysrY" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 36664207DE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id B971E8D0011; Tue, 18 Aug 2020 10:58:27 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B20348D0003; Tue, 18 Aug 2020 10:58:27 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9E73B8D0011; Tue, 18 Aug 2020 10:58:27 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0096.hostedemail.com [216.40.44.96]) by kanga.kvack.org (Postfix) with ESMTP id 84A5D8D0003 for ; Tue, 18 Aug 2020 10:58:27 -0400 (EDT) Received: from smtpin03.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 28CF01E1D for ; Tue, 18 Aug 2020 14:58:27 +0000 (UTC) X-FDA: 77163995454.03.star20_200793d27020 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin03.hostedemail.com (Postfix) with ESMTP id EF1E528A4E8 for ; Tue, 18 Aug 2020 14:58:26 +0000 (UTC) X-HE-Tag: star20_200793d27020 X-Filterd-Recvd-Size: 5496 Received: from mail-io1-f65.google.com (mail-io1-f65.google.com [209.85.166.65]) by imf47.hostedemail.com (Postfix) with ESMTP for ; Tue, 18 Aug 2020 14:58:26 +0000 (UTC) Received: by mail-io1-f65.google.com with SMTP id b17so21425961ion.7 for ; Tue, 18 Aug 2020 07:58:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=vOEA2rP9/JD6Cf76I2R3GGke75F7JOtu4CdmYgf8vDY=; b=sObKysrY/m6k71IrKg0OKwNuztPj+2ApCNCaDg5eevrRQ+xH5K4vrlPCXTOjWYnhBx N5gWOfpWzu45gDBj3AmUDpXLCo02KiGLddVIxkvkmFEEZQSccy8ViWZdSDpQackugrQx P3XeZwcPxMEvZbMTP/OxJSz4mFyrpJId3fjzupe5RHJOJHi4I+BfU/SI9hqVu16kKS32 qRK1/HmLKkgXJ3XXvAI3KoE+G3QWCKE8Qx5xgseT51v+FyyboOuunaNv/IW5WS9z2tYT G6WLGh4XR+YcYhsWkb53O/Vz+gKZ9lbhawwb8MuLAvkMJ3ilWr+rUcom2roj3loVLhSS 27aQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=vOEA2rP9/JD6Cf76I2R3GGke75F7JOtu4CdmYgf8vDY=; b=LmkD8OIujmzAZWo2/VJd+8Uol0CxWz9XzAuD9kLVcmIpEsYyfUZyNiaIKQVIJONGC4 8gYVMJzyZ5u21aNL58yzHUzsc/tixqpHvn5nZuGmBnwMUx+lRHLfZf1uGkH542KRNwjH uUO93C56o+wCxBizRKMQ0OeRBokVpkEdJI/SKVaHAeQmGsV31GO2SLx9Ab1XiNZY/CoQ ssc8E1A9yB5KGn1MhITVQ7u0Ai38I3fNcm3w7S+JzMFQmsGTW6o2q0AWGDphpSXtqAO7 QW5y7Bt+/9vo7TTWBxpQgO+IahA13Xizvgt7bDs+oG90Cgk9o/08M3CRdBNdT6ID+1Sj S9cg== X-Gm-Message-State: AOAM531Vv5Z4aaQLOAb7KTLAGPX9/7sRAfhEeX8ghJxY8Iivg9OZgedr 3y6vm0Un5aHQ+yuiElSJpbWH2LI0cqdk8EWav6M= X-Google-Smtp-Source: ABdhPJy11n6vtEdpb4Yt79Cgo6EA4IQ4lhtjTCOOWRi3rSkmsGOG4Jca6HSsIzdteiY+8sKovq1y/uZMuLnb/A9ujV8= X-Received: by 2002:a5d:8f09:: with SMTP id f9mr16787030iof.187.1597762705945; Tue, 18 Aug 2020 07:58:25 -0700 (PDT) MIME-Version: 1.0 References: <20200817084836.29216-1-richard.weiyang@linux.alibaba.com> <20200818032217.GA31960@L-31X9LVDL-1304.local> In-Reply-To: <20200818032217.GA31960@L-31X9LVDL-1304.local> From: Alexander Duyck Date: Tue, 18 Aug 2020 07:58:14 -0700 Message-ID: Subject: Re: [PATCH] mm/page_reporting: the "page" must not be the list head To: Wei Yang Cc: Alexander Duyck , David Hildenbrand , Andrew Morton , linux-mm , LKML Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: EF1E528A4E8 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam05 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 Mon, Aug 17, 2020 at 8:22 PM Wei Yang wrote: > > On Mon, Aug 17, 2020 at 09:05:32AM -0700, Alexander Duyck wrote: > > > > > >On 8/17/2020 2:35 AM, David Hildenbrand wrote: > >> On 17.08.20 10:48, Wei Yang wrote: > >> > If "page" is the list head, list_for_each_entry_safe() would stop > >> > iteration. > >> > > >> > Signed-off-by: Wei Yang > >> > --- > >> > mm/page_reporting.c | 2 +- > >> > 1 file changed, 1 insertion(+), 1 deletion(-) > >> > > >> > diff --git a/mm/page_reporting.c b/mm/page_reporting.c > >> > index 3bbd471cfc81..aaaa3605123d 100644 > >> > --- a/mm/page_reporting.c > >> > +++ b/mm/page_reporting.c > >> > @@ -178,7 +178,7 @@ page_reporting_cycle(struct page_reporting_dev_info *prdev, struct zone *zone, > >> > * the new head of the free list before we release the > >> > * zone lock. > >> > */ > >> > - if (&page->lru != list && !list_is_first(&page->lru, list)) > >> > + if (!list_is_first(&page->lru, list)) > >> > list_rotate_to_front(&page->lru, list); > >> > /* release lock before waiting on report processing */ > >> > > >> > >> Is this a fix or a cleanup? If it's a fix, can this be reproduced easily > >> and what ere the effects? > >> > > > >This should be a clean-up. Since the &page->lru != list will always be true. > > > >If I recall at some point the that was a check for &next->lru != list but I > >think I pulled out an additional conditional check somewhere so that we just > >go through the start of the loop again and iterate over reported pages until > >we are guaranteed to have a non-reported page to rotate to the top of the > >list with the general idea being that we wanted the allocator to pull > >non-reported pages before reported pages. > > Hi, Alexander, > > I see you mentioned in the changelog, this change "mm/page_reporting: rotate > reported pages to the tail of the list" brings some performance gain. > > Would you mind sharing more test detail? I would like to have a try at my > side. > > Thanks :-) I seem to recall my default test for most of this was the page_fault1 test from the will-it-scale suite of tests. Basically I was running that while leaving page reporting enabled. However I don't know how much visibility you would have into the performance impact as I seem to recall I had to modify the frequency of scheduling for the reporting polling task in order to see much of an impact. Thanks. - Alex