Received: by 2002:ab2:7b86:0:b0:1f7:5705:b850 with SMTP id q6csp223845lqh; Fri, 3 May 2024 21:27:32 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXG8QFSDb4OLzWabBw5LDFQdYG4kgVTOjoiuFnfJ1UVaWoppI8IUOy/dtz1nUE/Co9ve50gCL6s1trLIPNAV7RC70yLCE0PVTGrg+7jrg== X-Google-Smtp-Source: AGHT+IGB8Z4V/IfWQJwMt42IM56mERCYCxGzjPAcCRgkE1xna/XS0+WxxZiMZriClZku+4RWDEWz X-Received: by 2002:a05:6214:5093:b0:6a0:c812:154e with SMTP id kk19-20020a056214509300b006a0c812154emr5403716qvb.17.1714796852364; Fri, 03 May 2024 21:27:32 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714796852; cv=pass; d=google.com; s=arc-20160816; b=ALR/nd1Xff3f/Gy329TyadRxVs+BhMY4+c1d6dhTT/lC1H8qHZcFXRKZnpBs97P4FF CBkPfcHDej6f2E/qDUfF8cudUAqTQ+xOFOe+dLoiqHFnMnptKwWwX3N55Knyb5JAsIRd ivSZ26DTw+BfJ++qMh87ZhtT0X1FxeDwsM4htSbimeYNer72KGg9RkA6kESKXm9IPtrd 1K2qLMQ8dMWDz9z9czKotKcqHmaAKji0mWTI0Mv0lATUJelmSOxNgkIBrHbGwRdev9Ni KT7J70TIc9VfoLiTphTcQcT9FYFYSObUrYTSINoOZcrvXF+R6P/hGQcoIgEXP6uynOu7 LbMA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=XDD/yCGw7jn5yR/Hffav3ixMpXa6OVJh41weDeDyIKY=; fh=b8DRsulkCDLVW3RMf/eilwjUmKLTcQPEUG3Htk5WFJM=; b=A8SO1sa2URQPcgL5vGpzObUZ0NaTQc00gwmYqNKBI6QY4qlOIiv+B+sPZZQCgZlg+Y 2gQwA5OngsNGhA9LaCPtBtzq5YCRKC2UxBxrUR+Hq75FcGiGz5GUEHHbyphmbDw6kNlD YrL/M83aj/3DWF0iSTQ7w8MVQp8uEHRRy0VaTHlD2XkUHC65Nw74rmclL681FjSOF5dB jM9zxidEY/f2nqhmcxCnq0h2XHdbC4d/fyrQ76g/nNvGpoAlZLLzkIU72cpa4c02SxRK PxkxPxvXm8sXuqNModG2+GdPGgA9XzpBZpYru1jGLBVs7RaOkmTxKTgS+PZvZ5bnmRdv e4tA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=J2Y5+Be6; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-168512-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-168512-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id q2-20020a05621419e200b0069e9680ddc8si4611209qvc.440.2024.05.03.21.27.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 21:27:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-168512-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=J2Y5+Be6; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-168512-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-168512-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 1C8E01C21B48 for ; Sat, 4 May 2024 04:27:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3679811711; Sat, 4 May 2024 04:27:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="J2Y5+Be6" Received: from mail-yb1-f175.google.com (mail-yb1-f175.google.com [209.85.219.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0FA5710A23 for ; Sat, 4 May 2024 04:27:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.175 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714796846; cv=none; b=u5m8ahahDm6+xwgvj9U9EEADRGFmBNabLYuFzHqdzGbvga2rdFQQaX6ra5OcZ+Fu5Awjr+pI09DAiv7TAR0auFlTnDSc/8O0vfwXcWEGPmF4GIkXq9jU1JDzyu+HgIsVLxvgYhDrDwI1X4pTeE/MAwzdEaYOAo3wevHUka9xegI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714796846; c=relaxed/simple; bh=XDD/yCGw7jn5yR/Hffav3ixMpXa6OVJh41weDeDyIKY=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=eCEwiVSS9EjkYzJhmfT6jwsPb0cIDFD1FTxunG/Naak8DcOFxWYWgnyrjEDwRMCSpr1dqgCMG1A5KJegI3CcwWLu3Lqz0ENqepgs9ZhY9g3IQhYyh8IcDqy6R59Vs20/6v8P+MuDBEbLjHEMxb14QdARprH5WTxqR8k35vCau8s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=J2Y5+Be6; arc=none smtp.client-ip=209.85.219.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-yb1-f175.google.com with SMTP id 3f1490d57ef6-de4665b4969so292315276.2 for ; Fri, 03 May 2024 21:27:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714796844; x=1715401644; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=XDD/yCGw7jn5yR/Hffav3ixMpXa6OVJh41weDeDyIKY=; b=J2Y5+Be6W3SU6Y1mOqIsZMEOAz0UnAiOMJPkcKhzaIOwE3W9/6Z+nLh8cINylseU7z DNu8wOeNq8qZu2bj2hPxauHIYS8htJKFgNXRtLQcf4JXwqDLNyxeXa4wWtXYhMqPHkSu JXhX5bLby3IGpG1WAdBlQKgpNXHoz3tybIwzAh437CdN/VAYMRqYaLSIs0KhAV/DrkRK fzMK92afnmWL8s74xfbMfNko5BMwD3OA4sGxNl3fd84h1NzKPCNOZFrWoybR1VooD4Lq pguBrl867wfNYoRcQ9q7MUgyRyj2DQKovcDsMIaWeMAPUO/yRAr3EEV1yh6yT9RqqjzW pdhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714796844; x=1715401644; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XDD/yCGw7jn5yR/Hffav3ixMpXa6OVJh41weDeDyIKY=; b=UMegK7L4zjGlDy4SprsbIIu9dg8CPv70AR6Pbq33Gcr+QXzzWM5fIZkLrdKMcceJu9 T7Tcv7a3+uHdVmgEezpRP7PSzznPA/WITq0VF9+9+YRZRqEa4wuDkbRv2+mPC1SPq7ON dzvAoCxbS/Tp6WUgESt4r28ryCDNx8J9a1OAVVlq6fhRl/l7MJvIq7toCON8tlxi1GyU f2V2a/u8rXos8vBS4pVNF6KPXGGdLOtRgyByfmI1f+huHIn/ZNJWMTA91bGGt2FfAPs2 1ZsJT4uyrQpLF4GCDgrDvGzK8knUgxWxwWphTQV1W55+Q92o3fSo3/Tbx+XPWsR04j4i AkYQ== X-Forwarded-Encrypted: i=1; AJvYcCV1q4NorGkzuhuPDZB60OScaCF3HzM3ojKI6bJZnYMS5V00cxGbPxg/npljKl1lbK2HQ3Pk8dn/Nddi4fypKSVLXjI2ldp7k/eQBByV X-Gm-Message-State: AOJu0Yz+aZr2sZcFvpXqh/OVe7M0rOCERPHrmcGlNSXTnxvXFBGZb3H+ awSWpVU25CsEH39u7IQPvU7wYTbFMMjsGD7G9NRE6btCZd70OK7zr9suFkk6tJIz0uNSPv0/vn3 KeWSTm/jtZEDX3jbM5hFraWnycIE= X-Received: by 2002:a25:2009:0:b0:de5:c1a4:560c with SMTP id g9-20020a252009000000b00de5c1a4560cmr4983744ybg.56.1714796843850; Fri, 03 May 2024 21:27:23 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240503005023.174597-1-21cnbao@gmail.com> <20240503005023.174597-3-21cnbao@gmail.com> In-Reply-To: From: Barry Song <21cnbao@gmail.com> Date: Sat, 4 May 2024 12:27:11 +0800 Message-ID: Subject: Re: [PATCH v3 2/6] mm: remove swap_free() and always use swap_free_nr() To: Christoph Hellwig Cc: Chris Li , Ryan Roberts , 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sat, May 4, 2024 at 12:03=E2=80=AFPM Christoph Hellwig wrote: > > 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. swap_free_nr() isn't separate, after this patch, it is the only one left. there won't be swap_free() any more. it seems you want to directly "rename" it to swap_free()?