Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp135579iob; Tue, 17 May 2022 21:27:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx9VlXOe4EWkZs4oxgazYHLoC8kIHL91tt+ixU7K7oNDLnhlT/41X2azENQV5E2iWTTyZm9 X-Received: by 2002:a17:90a:8041:b0:1df:991f:df24 with SMTP id e1-20020a17090a804100b001df991fdf24mr5136344pjw.19.1652848031464; Tue, 17 May 2022 21:27:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652848031; cv=none; d=google.com; s=arc-20160816; b=ZQsdhdpjtTWKjwhUzlWyqgQPAtLTHZOzDkXopBG8vLZ8P0buKL4bcVd1XuN6Ojt/7O zLp+pYwId5/QK3GtVsfeEWeZJRSm+O4NtGzPurdIrp7JF0uqjMNH/0/2F4RyAbmwBlcy 45pltat2tx/6C6cAz+ZyUfyjwQAMPQM8DqAgv51GPltOch9wX61+sOq6FQbKRmfV7U9E 3WzSM3i/CtHNG2/XAcLYVgouGLa/O2UGS9Ns45SX23EREfELi70bXCJwksl4948aaaBm I3YTiKUX1Ycdi0Vjb91LJkst9SELksLhV6mirnY57TqSdUaa76Ab2vy8afkRi43zaOH3 w0+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=+ytKDU61o6P6DJnRMuG4f/LNhF7zYLiqSygbpdA7iO8=; b=EuNP94UeBnKa96+EDS4BeJzt5+wt/6CF83lGz3+EDPgePrYvBRvBMfo4Dgw0KPONoE RPQjVmvGwltjPOZjmmV/1GRlRYNIx1ayWtswreo6W1EyVKM1vVRQXMDpABgg5Kr+L538 UyAP84UA+8RabQcvfLTltpSAolQohgAWnACuYQPDhUCa5UGiMPXtAPCX9BUfXJf4QFP7 jLSIFaZEfK1+3GF9zpMKLvyOUi1y6qQXD7061wga9xEELcZGJ3nPTxDirXjAl5Tahiqk uON5j+K/f6sRwKya/dMh1nuaSARoBzEADrqbvlVXRhlOkjVhZQEi/fria4orZI0L+rn6 N4Zw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=MjeauKwg; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id o17-20020a170902d4d100b00158e5bfcc7dsi1627746plg.136.2022.05.17.21.27.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 May 2022 21:27:11 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=MjeauKwg; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C5D85AF1D3; Tue, 17 May 2022 20:50:23 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231768AbiEQXjO (ORCPT + 99 others); Tue, 17 May 2022 19:39:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39140 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229655AbiEQXjN (ORCPT ); Tue, 17 May 2022 19:39:13 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9202E527DF for ; Tue, 17 May 2022 16:39:11 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 2AF0FB81D63 for ; Tue, 17 May 2022 23:39:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 70938C385B8; Tue, 17 May 2022 23:39:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1652830748; bh=JEWdfhbC5CbWSi17hxZuBVoj601BdghMmPGpjgottKo=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=MjeauKwgia4b2KAd9VrN1ZKzelXPYmVvRqOQKfHOfWBf/zSiTNHV+qvACr/8++N94 i5Hcame/r39FW5rqsjTWcFaJb2fzcM6g/5Y02n0Xoo5Em8TcypXr/WHPZy80qsDxjX lxNll3G/mRyfWRzhB4hMql3m5y5pgAi6gFjAy5Jc= Date: Tue, 17 May 2022 16:39:07 -0700 From: Andrew Morton To: Miaohe Lin Cc: David Hildenbrand , , , , , , , , , , Subject: Re: [PATCH 06/15] mm/swap: remove buggy cache->nr check in refill_swap_slots_cache Message-Id: <20220517163907.223f16f071b57b9e3d062ff8@linux-foundation.org> In-Reply-To: <8b03aa8a-5023-6915-64c6-f6f298f19f36@huawei.com> References: <20220509131416.17553-1-linmiaohe@huawei.com> <20220509131416.17553-7-linmiaohe@huawei.com> <8b03aa8a-5023-6915-64c6-f6f298f19f36@huawei.com> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 16 May 2022 10:00:43 +0800 Miaohe Lin wrote: > On 2022/5/12 21:37, David Hildenbrand wrote: > > On 09.05.22 15:14, Miaohe Lin wrote: > >> refill_swap_slots_cache is always called when cache->nr is 0. And if > >> cache->nr != 0, we should return cache->nr instead of 0. So remove > >> such buggy and confusing check. > > > > Not sure about the "cache->nr != 0, we should return cache->nr instead > > of 0" part, I'd just drop that from the patch description. We'd actually > > end up overwriting cache->nr after your change, which doesn't sound > > right and also different to what you describe here. > > Will do. I've updated the changleog to simply : refill_swap_slots_cache is always called when cache->nr is 0. So remove : such buggy and confusing check.