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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9CE3EC433EF for ; Sat, 26 Mar 2022 15:50:26 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1BCDD8D0002; Sat, 26 Mar 2022 11:50:26 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 16B7C8D0001; Sat, 26 Mar 2022 11:50:26 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 00BDA8D0002; Sat, 26 Mar 2022 11:50:25 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.27]) by kanga.kvack.org (Postfix) with ESMTP id E4CE88D0001 for ; Sat, 26 Mar 2022 11:50:25 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id A999E20A0A for ; Sat, 26 Mar 2022 15:50:25 +0000 (UTC) X-FDA: 79286974410.07.6D98A1A Received: from mail-ej1-f49.google.com (mail-ej1-f49.google.com [209.85.218.49]) by imf04.hostedemail.com (Postfix) with ESMTP id 3480340042 for ; Sat, 26 Mar 2022 15:50:25 +0000 (UTC) Received: by mail-ej1-f49.google.com with SMTP id c10so2258037ejs.13 for ; Sat, 26 Mar 2022 08:50:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:reply-to:references:mime-version :content-disposition:in-reply-to:user-agent; bh=OGCQNOw1Se0K0qXz1pxIgif7mQdrfH8tD2xtpZ00QKA=; b=NHOrYe3Kw3Gm6xFJ+J0XF8+3iDYw+6td04sxOHOSkrUvjaNOOkT6CxS/R5ipFQAbdL FpjZ0sEqF/dDg0ThbgCVi3KzDccdXyOecoURkVHD/Wuq49NKFW+WydB9d8vdQn2EgFTC vTogx3sece5F2OCaBDqab2nBFFVv+/EN492m3+f7DxrSSc+zTVjoqrOkdKsGPQ4O9eHL yR+IIBLFnyO/sZRg9Vo77wWFj9m4VEbpXAH/gNI+Cr+oUYNauayJ4LpGgIpHS9Gy292S pR3jpiUz0GquRUyyGAAEsuTy1VD42qd8N5vFMmuRkTJxTL/9OCaISWpDftaJ6UA5jqwI Ye6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:reply-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=OGCQNOw1Se0K0qXz1pxIgif7mQdrfH8tD2xtpZ00QKA=; b=iUrOt2mpCsyL0YDcObI4AKMm0re6BwIOutqCHV0oRGQToKlFo+9/BJMiv3ONt+PUuZ Jh65DQZecv1pgweUPOjS3DAoXcn1qWg+0oQa2efsDRngQRqSSfMx7BktXa5qeTO+tUR/ euZz5ggm5K+0D5Uj0yInbMfCNa1S+Mmj6AX14N15u/sy4MEkNt0XOIfq2PwkvjZZhj7f LrG0KMXVehcQqCjvIVm6O7TAvhWOxAJO8LB5KN/xUgPHn+ZqRufSTM49hhUVnEetq3wy egDHqi5LN6H+RyuHvUn5J3xX5qNCC5vUnn+5/kE5sKJB7wPnQjDDHO5SPRhhUDXH0bD5 FUyA== X-Gm-Message-State: AOAM533vM6VOshghcpwXZcndQOCKb5tW6Ek5jJ/HTk4U+Y6olOP0kAfM fC0M3FZES5FBBoposD1dY/O1WxCr3i8= X-Google-Smtp-Source: ABdhPJywcyPim9N/QtlOICDAoM8iJGZOReK8MLK0NuX03aOzBXK0pI/jdpFfqljR5B6opmUAo1meSA== X-Received: by 2002:a17:906:7706:b0:6d6:e521:5471 with SMTP id q6-20020a170906770600b006d6e5215471mr17762757ejm.387.1648309823909; Sat, 26 Mar 2022 08:50:23 -0700 (PDT) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id 17-20020a170906059100b006cee1bceddasm3638026ejn.130.2022.03.26.08.50.23 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 26 Mar 2022 08:50:23 -0700 (PDT) Date: Sat, 26 Mar 2022 15:50:22 +0000 From: Wei Yang To: Mel Gorman Cc: DaeRo Lee , akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm/vmscan.c: no need to double-check if free pages are under high-watermark Message-ID: <20220326155022.6pqxcfazjaw47eu5@master> Reply-To: Wei Yang References: <20220102033129.12913-1-skseofh@gmail.com> <20220106094650.GX3366@techsingularity.net> <20220106125758.GY3366@techsingularity.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220106125758.GY3366@techsingularity.net> User-Agent: NeoMutt/20170113 (1.7.2) X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 3480340042 X-Stat-Signature: mmmf4pbrt8yojjmyqity8rn5iawnofzm X-Rspam-User: Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=NHOrYe3K; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf04.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.218.49 as permitted sender) smtp.mailfrom=richard.weiyang@gmail.com X-HE-Tag: 1648309825-633118 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 Thu, Jan 06, 2022 at 12:57:58PM +0000, Mel Gorman wrote: >On Thu, Jan 06, 2022 at 09:03:34PM +0900, DaeRo Lee wrote: >> > > @@ -4355,7 +4355,7 @@ static enum zone_type kswapd_highest_zoneidx(pg_data_t *pgdat, >> > > static void kswapd_try_to_sleep(pg_data_t *pgdat, int alloc_order, int reclaim_order, >> > > unsigned int highest_zoneidx) >> > > { >> > > - long remaining = 0; >> > > + long remaining = ~0; >> > > DEFINE_WAIT(wait); >> > > >> > > if (freezing(current) || kthread_should_stop()) >> > >> > While this does avoid calling prepare_kswapd_sleep() twice if the pgdat >> > is balanced on the first try, it then does not restore the vmstat >> > thresholds and doesn't call schedul() for kswapd to go to sleep. >> >> I intended not to call prepare_kswapd_sleep() twice when the pgdat is NOT >> balanced on the first try:) >> > >Stupid typo on my part. > >> > @@ -4406,11 +4412,11 @@ static void kswapd_try_to_sleep(pg_data_t *pgdat, int alloc_order, int reclaim_o >> > } >> > >> > /* >> > - * After a short sleep, check if it was a premature sleep. If not, then >> > - * go fully to sleep until explicitly woken up. >> > + * If balanced to the high watermark, restore vmstat thresholds and >> > + * kswapd goes to sleep. If kswapd remains awake, account whether >> > + * the low or high watermark was hit quickly. >> > */ >> > - if (!remaining && >> > - prepare_kswapd_sleep(pgdat, reclaim_order, highest_zoneidx)) { >> > + if (balanced) { >> > trace_mm_vmscan_kswapd_sleep(pgdat->node_id); >> > >> > /* >> >> But, I think what you did is more readable and nice. >> Thanks! >> > >Feel free to pick it up, rerun your tests to ensure it's behaving as >expected and resend! Include something in the changelog about user-visible >effects if any (or a note saying that it reduces unnecssary overhead) >and resend with me added to the cc. > Hi, All Seems this thread stops here. I don't see following patch and current upstream doesn't include this change. May I continue this? Of course, with author-ship from DaeRo Lee . Mel, Would you mind suggesting some cases that I could do to see the effects from this change? Such as the overhead or throughput? Or what cases you expect? -- Wei Yang Help you, Help me