Received: by 2002:ab2:7b86:0:b0:1f7:5705:b850 with SMTP id q6csp217822lqh; Fri, 3 May 2024 21:04:21 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVt/4qYUBjSyy39THJxc1zOKWw8zQ7xSeoI8+PG7RXK5dv6KwnRxf4McEZ3SeQ5ZAy2eeiWHtvAZoEkhBtCiPia2rG++lGl4SFYhsYbxQ== X-Google-Smtp-Source: AGHT+IHlJnGFjBS4jZKIrwD8Gi6baRkVmK6EKfrOF5citsxMHjlwtOblSS2iYlwsjlQwqt5AjGQj X-Received: by 2002:a2e:b8d4:0:b0:2e2:72a7:8440 with SMTP id s20-20020a2eb8d4000000b002e272a78440mr2649380ljp.41.1714795461683; Fri, 03 May 2024 21:04:21 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714795461; cv=pass; d=google.com; s=arc-20160816; b=HKQj4/sYpd/2OXQFny9ElawitoAsOzpTlB6vuwQia8EOdkiLPSVewZN1hF3Omk3tVx FXe/9dOPS9pDe5NNyFT/ug9dgcsFaj8R9U9D3Lr/rbEi0qRpH7/QZhsVTxR1qGcMHFCK pKVFWfwilL6h9EEd9+ONiL0GTAldEd82pxoM5QNtuz2ftOT6WyUBtOHSuGM2oux48G9w BMNIRRoMvWl/6OxFtGYD8J5wrqQ2WiK7qzeNwnbjNKWvFvTu2Jft3T4uM0SuY0zm8L8J ziJNZ8kQSJnbx4fMwJeXfZqM7SfyZlSlS6HCHIGDO7fmL6/yH0TWROrGoHlBSYeFI+28 NOGA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=SYAmbYA39mRMtra9kKxfupAmrezK4kfaxBes562k5XE=; fh=vqznmAMH4semCl9Cmq92seLSrlpiKcK8Q4YKB48GXls=; b=jkd/WDuv3gj/BSn/xdANMuP+RPS+Kgk4RmpY3oV5GO4otmmqm+A+DyzYqbTjxph2sv arVwVgH+NPPmrgBVh7l6tzQofjppcHhobAzS/0c5M83doAAf2CDz9mjsd/1p1I+qVTec o8hxVs7nG34Em0hMsYxQP3jEyQJ6jGLXqs3EFRnnZFn+O58qjaCs4G0/BCEYpyMQ7ohO 2S7hV7g1faxTOaU+DV+xGQAyUdgqBWCfrWrQ+CZY9gB0at7VZtJ71nmeYlbD6xMppt/T 2knRYxXQVwppvGB0VY5KlLGo/ivfDgyayqwlVVLpuOhKjC0OWUAs+SXyCfCqHojjbIKO TVdQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=vifOKZQ1; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-168509-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-168509-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id b22-20020a17090636d600b00a46e9f5a524si2276461ejc.957.2024.05.03.21.04.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 21:04:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-168509-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=vifOKZQ1; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-168509-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-168509-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 5D8281F233B9 for ; Sat, 4 May 2024 04:04:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8405510A22; Sat, 4 May 2024 04:04:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="vifOKZQ1" Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 29A57AD2D for ; Sat, 4 May 2024 04:04:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714795454; cv=none; b=B2tPg5rejChdowg6O79wroBWuwfLiTVtRWv+kx53Rk5YQZleh4+0+RuDTNbWC850gLnuOzDHKSefGkUxEN5ULeXfk6bZbC1MQqvZxQoDclQAgFF+nrabW7Ow2xCWDsHvpL47u3dCl5syvQSflFnUd3IjYM8Dew/07smdvGX8Nis= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714795454; c=relaxed/simple; bh=SYAmbYA39mRMtra9kKxfupAmrezK4kfaxBes562k5XE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=fPM8zCqnm0ogHqSNeAcL+u2n+USi7g1jissNJIeCwAKPXuCwYKhjupGtoaf3KMJ9XCZCV3rLja5MCUUj9gr5F+Hqvs9+IJ4K5NBxp1MzOFWcvZLCdJaZHLaXMWEllqNIDMHTBbGXa79vCvOC+XVbagCqgPErkCtfiwimfh6Ug1Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=vifOKZQ1; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=SYAmbYA39mRMtra9kKxfupAmrezK4kfaxBes562k5XE=; b=vifOKZQ1gHFHOk602G+1pZl5YM QcI0pkFD5j13gQ4Hbq0In5APxg6Ze6lXKH6fstUB5zJ96BBSXTU5W7hCuwr3bjA+ZXJcULUnRZOAp waiKuifg5Ko709O92WBpsnWHjoPkkAHbz6Hu5gL9eVbXCoB3LHTdlPLyBlodH8YQTpT+vIYIesGh7 ZI5HMNyymjWWU/eH1I7OMiflt3HVlAQH7oK7zCWwS87WaO43o3PP6y7xS+iyaVeVGjuheu8a74E/w tpnANR1IPSLTMVeVuowRpemeaktWOn/Z2rVgjgB8hjRIERm6hR3bdq8PhvhLSWDKU2jEl60ir59Ma gAJ4uBWQ==; Received: from hch by bombadil.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1s36ci-00000001CKX-1MlN; Sat, 04 May 2024 04:03:44 +0000 Date: Fri, 3 May 2024 21:03:44 -0700 From: Christoph Hellwig To: Chris Li Cc: Ryan Roberts , Barry Song <21cnbao@gmail.com>, akpm@linux-foundation.org, linux-mm@kvack.org, baolin.wang@linux.alibaba.com, david@redhat.com, hanchuanhua@oppo.com, hannes@cmpxchg.org, hughd@google.com, kasong@tencent.com, linux-kernel@vger.kernel.org, surenb@google.com, v-songbaohua@oppo.com, willy@infradead.org, xiang@kernel.org, ying.huang@intel.com, yosryahmed@google.com, yuzhao@google.com, ziy@nvidia.com, "Rafael J. Wysocki" , Pavel Machek , Len Brown Subject: Re: [PATCH v3 2/6] mm: remove swap_free() and always use swap_free_nr() Message-ID: References: <20240503005023.174597-1-21cnbao@gmail.com> <20240503005023.174597-3-21cnbao@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html On Fri, May 03, 2024 at 01:37:06PM -0700, Chris Li wrote: > Either way works. It will produce the same machine code. I have a > slight inclination to just drop swap_free(entry) API so that it > discourages the caller to do a for loop over swap_free(). Then just ad the number of entries parameter to swap_free and do away with the separate swap_free_nr.