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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 14E04C433FE for ; Tue, 17 May 2022 23:39:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231854AbiEQXjO (ORCPT ); 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 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.