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=-11.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, 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 3FE31C433DF for ; Mon, 17 Aug 2020 15:38:17 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id BFBE1208E4 for ; Mon, 17 Aug 2020 15:38:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="IUxAnms4" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BFBE1208E4 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 0834C6B0010; Mon, 17 Aug 2020 11:38:16 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 00C9F6B0022; Mon, 17 Aug 2020 11:38:15 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DEFC66B0023; Mon, 17 Aug 2020 11:38:15 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0123.hostedemail.com [216.40.44.123]) by kanga.kvack.org (Postfix) with ESMTP id C28976B0010 for ; Mon, 17 Aug 2020 11:38:15 -0400 (EDT) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 66FAE180AD820 for ; Mon, 17 Aug 2020 15:38:15 +0000 (UTC) X-FDA: 77160466950.17.copy45_4a08b6e27017 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin17.hostedemail.com (Postfix) with ESMTP id E7072180D0186 for ; Mon, 17 Aug 2020 15:38:14 +0000 (UTC) X-HE-Tag: copy45_4a08b6e27017 X-Filterd-Recvd-Size: 8177 Received: from mail-io1-f68.google.com (mail-io1-f68.google.com [209.85.166.68]) by imf06.hostedemail.com (Postfix) with ESMTP for ; Mon, 17 Aug 2020 15:38:14 +0000 (UTC) Received: by mail-io1-f68.google.com with SMTP id b17so18020833ion.7 for ; Mon, 17 Aug 2020 08:38:14 -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:content-transfer-encoding; bh=4Bkdz+k72rLGRx5zfmph4t7mOQMS3PzCCK/DsnCmnNk=; b=IUxAnms4s7sSclWkvmw5QiiHjkg484hwDAcSl/TapXh0pQyfDNpoGhtsiLGdSP8sI/ rJ3nFoUmNjxtIlAuvyzlLaT+dNCimN4koRcvtUfx34lpUMOAitgRZOoSGPR/faSU36+h W5P3Fnp/zOYblyl4nLFp35Nn3FWPjieLKlt0s279lug2G5pIov2EQZ456vEhAt+0gU2P UUNVf7+sJ7+D3VGcI1+FDJ0mRse6hzZ2N4+R64jBzVA5DRfFjeGhMTN8BHPrUAEyGdWU WAP7k37sKE7kIjzWuy+Wk4na9F1Am+y7QYk/VIDlyxwUKIKPvwVKQYDv+2+YYuiR+89Y rVTw== 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:content-transfer-encoding; bh=4Bkdz+k72rLGRx5zfmph4t7mOQMS3PzCCK/DsnCmnNk=; b=ZFBezmCFyfoPanQ3gaDfu9uwdWdpH/1b2UAbKTvRxMOjtjQNdSSDqhrNUd8WiPx8xB Gm3khGjnOkS+caG3500KlJSZ8ciXtWMlw2iHPtEnVsSZVLVVhTSHzi8bBjaytoHo5c4M mGBX1qyHZaxakshH4IN241IccQ6SMv59hm+4I73CvMv5XcdvzE/rXe/nnKlDVYnm4tKf S2jS/UvkZcnjRcTaJKzRqP/z3GEP3vsE9QmBDHcAvleLPbw+xDOLgYFmBWFlhC8VfpYH l/NNHt+4wwsUYl2zGIzdLcQBhtunN8Wv0KotjrTuD2jciDInCUtFGiXXBJ3y2WdrgBsK 9L1A== X-Gm-Message-State: AOAM532Trhu+JDMhiBo6bptDp9s2CBFHpgx8+EpPVjwabpQqK/zT1P22 ENXNeXb2tRg6xxXM74cvqoEhcK1YZWhnJhFcyrQ= X-Google-Smtp-Source: ABdhPJyOwbaMmiZwnk764Naqoxki1LO6gp/dMIbwdpnsdnjdWOCh0o6U7UJnMVNK2M9r7HHawNWHPgFvpAzlUFE4fFA= X-Received: by 2002:a5d:9051:: with SMTP id v17mr12402353ioq.88.1597678693579; Mon, 17 Aug 2020 08:38:13 -0700 (PDT) MIME-Version: 1.0 References: <20200813035100.13054.25671.stgit@localhost.localdomain> <20200813040232.13054.82417.stgit@localhost.localdomain> <6c072332-ff16-757d-99dd-b8fbae131a0c@linux.alibaba.com> <650ab639-e66f-5ca6-a9a5-31e61c134ae7@linux.alibaba.com> In-Reply-To: <650ab639-e66f-5ca6-a9a5-31e61c134ae7@linux.alibaba.com> From: Alexander Duyck Date: Mon, 17 Aug 2020 08:38:02 -0700 Message-ID: Subject: Re: [RFC PATCH 2/3] mm: Drop use of test_and_set_skip in favor of just setting skip To: Alex Shi Cc: Yang Shi , kbuild test robot , Rong Chen , Konstantin Khlebnikov , "Kirill A. Shutemov" , Hugh Dickins , LKML , Daniel Jordan , linux-mm , Shakeel Butt , Matthew Wilcox , Johannes Weiner , Tejun Heo , cgroups@vger.kernel.org, Andrew Morton , Wei Yang , Mel Gorman , Joonsoo Kim Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: E7072180D0186 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam01 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, Aug 15, 2020 at 2:51 AM Alex Shi wrote= : > > > > =E5=9C=A8 2020/8/15 =E4=B8=8A=E5=8D=885:15, Alexander Duyck =E5=86=99=E9= =81=93: > > On Fri, Aug 14, 2020 at 7:24 AM Alexander Duyck > > wrote: > >> > >> On Fri, Aug 14, 2020 at 12:19 AM Alex Shi = wrote: > >>> > >>> > >>> > >>> =E5=9C=A8 2020/8/13 =E4=B8=8B=E5=8D=8812:02, Alexander Duyck =E5=86= =99=E9=81=93: > >>>> > >>>> Since we have dropped the late abort case we can drop the code that = was > >>>> clearing the LRU flag and calling page_put since the abort case will= now > >>>> not be holding a reference to a page. > >>>> > >>>> Signed-off-by: Alexander Duyck > >>> > >>> seems the case-lru-file-mmap-read case drop about 3% on this patch in= a rough testing. > >>> on my 80 core machine. > >> > >> I'm not sure how it could have that much impact on the performance > >> since the total effect would just be dropping what should be a > >> redundant test since we tested the skip bit before we took the LRU > >> bit, so we shouldn't need to test it again after. > >> > >> I finally got my test setup working last night. I'll have to do some > >> testing in my environment and I can start trying to see what is going > >> on. > > > > So I ran the case-lru-file-mmap-read a few times and I don't see how > > it is supposed to be testing the compaction code. It doesn't seem like > > compaction is running at least on my system as a result of the test > > script. > > atteched my kernel config, it is used on mine machine, I'm just wondering what the margin of error is on the tests you are running. What is the variance between runs? I'm just wondering if 3% falls into the range of noise or possible changes due to just code shifting around? In order for the code to have shown any change it needs to be run and I didn't see the tests triggering compaction on my test system. I'm wondering how much memory you have available in the system you were testing on that the test was enough to trigger compaction? > > I wonder if testing this code wouldn't be better done using > > something like thpscale from the > > mmtests(https://github.com/gormanm/mmtests)? It seems past changes to > > the compaction code were tested using that, and the config script for > > the test explains that it is designed specifically to stress the > > compaction code. I have the test up and running now and hope to > > collect results over the weekend. > > I did the testing, but a awkward is that I failed to get result, > maybe leak some packages. So one thing I noticed is that if you have over 128GB of memory in the system it will fail unless you update the sysctl value vm.max_map_count. It defaulted to somewhere close to 64K, and I increased it 20X to 1280K in order for the test to run without failing on the mmap calls. The other edit I had to make was the config file as the test system I was on had about 1TB of RAM, and my home partition only had about 800GB to spare so I had to reduce the map size from 8/10 to 5/8. > # ../../compare-kernels.sh > > thpscale Fault Latencies > Can't locate List/BinarySearch.pm in @INC (@INC contains: /root/mmtests/b= in/lib /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendo= r_perl /usr/share/perl5/vend. > BEGIN failed--compilation aborted at /root/mmtests/bin/lib/MMTests/Stat.p= m line 13. > Compilation failed in require at /root/mmtests/work/log/../../bin/compare= -mmtests.pl line 13. > BEGIN failed--compilation aborted at /root/mmtests/work/log/../../bin/com= pare-mmtests.pl line 13. I had to install List::BinarySearch.pm. It required installing the cpan perl libraries. > > > > There is one change I will probably make to this patch and that is to > > place the new code that is setting skip_updated where the old code was > > calling test_and_set_skip_bit. By doing that we can avoid extra checks > > and it should help to reduce possible collisions when setting the skip > > bit in the pageblock flags. > > the problem maybe on cmpchxg pb flags, that may involved other blocks cha= nges. That is the only thing I can think of just based on code review. Although that would imply multiple compact threads are running, and as I said in my tests I never saw kcompactd wakeup so I don't think the tests you were mentioning were enough to stress compaction.