Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp1052251lqb; Wed, 17 Apr 2024 20:55:45 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVSJdOHojzc7fBOiDaMiWX+5jyGjLFeW6GSIrNr7UvumGas8WO34E4OpiJHH5XTJlU2ajolMTLL0CLvgTLxwK4nFvl/W12UHHirMQpReA== X-Google-Smtp-Source: AGHT+IHHMJT0qPqoTIsu/OUZb3I0vkMLo2LRAJp4RqmLnuRegDB5Qa+Jw+lcU9c0bMzSJPk+loEH X-Received: by 2002:ac2:4116:0:b0:516:c7c2:23b6 with SMTP id b22-20020ac24116000000b00516c7c223b6mr584259lfi.9.1713412545401; Wed, 17 Apr 2024 20:55:45 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713412545; cv=pass; d=google.com; s=arc-20160816; b=uo09OQA024qMAIwj6wSegsEBCF7mp3iHLHfvQ0P2HkpQ6P3VSVnARvVnQq36kGvCoW +3CRZeJcZTCFpGJgiRqgdMZPXui5iLgHJeAEsCYKV5QnyPPdVwrc+Orq1lGHMqSk2dBO oPv7+YB1QeMpsOwZVE29fOLatMKxXp6qDFwmAj/KVVnZQLppsYVBOUX9L7ShLFd1n9sT dLs5QfAuWFcxJrFW3cfwZ0GNFXMdVwDz3xqkZEeZ+dS+nL6R5iIjkiAQrC5FcFs/K/fZ /HCp2n4YFO+YpvJXOc18NNGWN3uTjzPVuH/s66A+kw0se/i077dh76zjdeX6re2BvoG6 hi4A== 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=HSFVsf7yg9xeJZAC97zFjVf1GebGLbTu3LyPHnS2CXE=; fh=2UFjFWCLiAQLnZcdHghiUAjQ6ObdKSKHtXz6b0TQnms=; b=j00DSQ1B+68GMBvIiKW6QaZzJfgemWsC4Pu5mQKQquDzhkhodrER0PuOZjdRMjCtx+ loWDXJvfI7ZwRM0HAjUcp1mihUfo8lGAYFfnvUk8rbiflQT3URe9dbee0Y6YEzo1g/3J ErBiXtPxV8ReWCKRcnCr69wq5wscuAFcE3Q+wt+LEcb6UMAi+mLErLQKDqIEvooRtMMe daqnp5AraHHu00hhg2Xkm1xlFoyJOIqTrbi3u6GK8pdbB17jdu08NHnx3b4YfYwmwAlj yquqR9hhToGld0o7SzMt+gAAA0I3yDNWJBkedr8iTWb27b1XhHEDMlRG82LBpKvV9rGs TLRA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=TVtsvFK3; 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-149484-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-149484-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id m27-20020a1709060d9b00b00a4739d7c665si374782eji.269.2024.04.17.20.55.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Apr 2024 20:55:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-149484-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=TVtsvFK3; 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-149484-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-149484-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 201041F221CE for ; Thu, 18 Apr 2024 03:55:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 190E15467A; Thu, 18 Apr 2024 03:55:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="TVtsvFK3" Received: from mail-ua1-f42.google.com (mail-ua1-f42.google.com [209.85.222.42]) (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 E662F4F1F1; Thu, 18 Apr 2024 03:55:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713412531; cv=none; b=dgtx9GaEoH2w2fLO5ROnOfUP2piwaZoqzaZWilkZfni9SsXU8a48r2cp47mWwEihLyG1PU7+6LN3ZD4teGVvTrB/y349Atuh65NM1ABRvP7DWxRfj/NjFqP8b3kivhCS2/mVv1AAHQ2BOgV5/uDggSXSgp07+N4B4r3KDKbMRcc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713412531; c=relaxed/simple; bh=uAI/w4LQxKfTnZZ97rhZLaZINNtDNRc6nO5ZqSFmCaY=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=pdBAlgFWUslr5ZGLS5qacD6Zza7/WwX16/Ow+qj5WHmyJ26vaBDkEBD9cveVW0MHsbMecoZSRCjV8D+G3p6vkdNTa3M+pLffZGmlIeGP+pVKTc/Z8J36sZQe3sb/eM2kTQKQmFzcGr87feb52czjBKInuMCJYE5uyYt5nelqvaM= 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=TVtsvFK3; arc=none smtp.client-ip=209.85.222.42 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-ua1-f42.google.com with SMTP id a1e0cc1a2514c-7e05b1ef941so105796241.3; Wed, 17 Apr 2024 20:55:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713412529; x=1714017329; 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=HSFVsf7yg9xeJZAC97zFjVf1GebGLbTu3LyPHnS2CXE=; b=TVtsvFK3z37PqjZKGy/GF8Oj1oTMe6feiJ0AY9HYWMuMKIZdBwlY1/kQRu6cq/k/38 NhWWjjNdP8z2vcO1X1b42vEQtQ7pkwCgBkO3HXf8A8k6qA0fBet8dM8gpKdHnGHloaPS q4YPF79bHX98ZObieL/phHSaJYnzNvM8bQJgJv9syG1BhHswFfoIp4LGDhKNRVSs7U3Z ZuqUWt+qFaRxozfMGZ53JzxF02zUovPzVDAJImode6GSWpVmj58Z19xdY3oQZTOiwQTU QtyltmHbKZQV7q7uXVV3eHsamyp10AyMHe5D+jzW8VyWeXW8tHkoFjGTL828pN2Hi0+E Civg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713412529; x=1714017329; 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=HSFVsf7yg9xeJZAC97zFjVf1GebGLbTu3LyPHnS2CXE=; b=jxvV/FXUNVBTEJq84Oua6nmUjzupStfa7+LLCM3Lx4EE0dmh5QFjEh8ThKUBAXnZiB SAC0LJsDG1k9AqFgUQsAUY980DKizZ5DR6G3yBou74AiFdllGz4moekpt5TUv3aRkHfQ 4JVcrtXH2zJa/UTPwFnLwhxt/7nmhBSAKqdpHXlF6gyLGMKVtCAjnQNvZ/tXwocnQO8s Fh2v+J8FcTlB5v2+zV6vGnIZYgyYfSE+UPjEyVreSvg2Sn1xbXaDWzYgZrAiaFnmY4dF 7NuvKWpZmMCqyJGBT1HtiT7nw2Tuv9jVdO1RjkiDawModt4fpf0ShD3cwwqDLxHeLD2D gE9Q== X-Forwarded-Encrypted: i=1; AJvYcCUqiMjUrt8IMme2VQ+rHBMfCc3cF4OqGAtn73gacincSjMXrm00uNr5/EkFu5EVh3LMjlsnFUUvCxRM5Te2J5SnMskdxAgJTjqKpxhxPZycCGmqGE5hcEEegZUSnuXqqnH0YuJrz7bryPEiGg== X-Gm-Message-State: AOJu0YyVzJeEjl/GVwzHa+XtnFa8Rpqhl1zVB28Brbb1OvhRlkDr/MPh isgfvxjQGUgn6mNkznhq/PxVwX97vuuzN7hrw2O08bL6It23947hfxa18zYKm/DHh/3Pm2yWuJU 9rXV4accn0cQKjvt0fslMsMJk0NM= X-Received: by 2002:a05:6122:a0a:b0:4c9:b8a8:78d4 with SMTP id 10-20020a0561220a0a00b004c9b8a878d4mr1803881vkn.3.1713412528761; Wed, 17 Apr 2024 20:55:28 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240417160842.76665-1-ryncsn@gmail.com> <20240417160842.76665-8-ryncsn@gmail.com> In-Reply-To: From: Barry Song <21cnbao@gmail.com> Date: Thu, 18 Apr 2024 15:55:17 +1200 Message-ID: Subject: Re: [PATCH 7/8] mm: drop page_index/page_file_offset and convert swap helpers to use folio To: Matthew Wilcox Cc: Kairui Song , linux-mm@kvack.org, Andrew Morton , "Huang, Ying" , Chris Li , Barry Song , Ryan Roberts , Neil Brown , Minchan Kim , Hugh Dickins , David Hildenbrand , Yosry Ahmed , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Apr 18, 2024 at 3:31=E2=80=AFPM Matthew Wilcox wrote: > > On Thu, Apr 18, 2024 at 01:55:28PM +1200, Barry Song wrote: > > I also find it rather odd that folio_file_page() is utilized for both > > swp and file. > > > > mm/memory.c <> > > page =3D folio_file_page(folio, swp_offset(entry)); > > mm/swap_state.c <> > > return folio_file_page(folio, swp_offset(entry)); > > mm/swapfile.c <> > > page =3D folio_file_page(folio, swp_offset(entry)); > > > > Do you believe it's worthwhile to tidy up? > > Why do you find it odd? What would you propose instead? i'd prefer something like folio_swap_page(folio, entry);