Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp1150271lqb; Thu, 18 Apr 2024 01:17:03 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX7LYS0CE7vhgyuLxEoKGyLpudCWrt0mSDSiR5uPVJ9GhhdAzChWdCt0PvztSuBOfloPP5Ka45Tr4RF9OzI19JxsoypD8Ygvupjqs8d9w== X-Google-Smtp-Source: AGHT+IFE+MR0UH3h5WgArt3YkMNnVyMZQ20oOUSTNzVAzIJ2iVeA69DB8tFIJeszj4vK6QAsWbgC X-Received: by 2002:a17:903:2345:b0:1e7:e7ed:7787 with SMTP id c5-20020a170903234500b001e7e7ed7787mr2316994plh.51.1713428223595; Thu, 18 Apr 2024 01:17:03 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713428223; cv=pass; d=google.com; s=arc-20160816; b=oOkx8G+uGvukz1caSI2XSUJHET1VhjoTTZ02la1AcOZ3bgQHl99KIhcEzeaO4iaEFN qX6FO58GEXhGzDywlFmi51aI49J66VelhP/ybm61WkrQuoALwe5i5RmV4LhvAKqiHZ5R 4NZjBT3BhOJPRh1VmPQJRyvg6/cn9tjLBqJeo8n7o5ajYEaNB+T3MsIIbUnrLtxvRVDa NxHzHHYC2Sh8oW+ax7hSPEIciPqStZ2Sic+G84guqCg8vUBBGe+F2vf7NN+SKnQk5zuj iA+ozk7w3QatoioHUQrM9qclPqZiEFJBkO52JEIq0G79NbQtLTT0HR+LQqqvjvVDWRAX hInw== 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=Zy7IR3Gvl36ziw9sf2woAp5XWV/QSQ6BNNUf9k7Ge6g=; fh=kpV+WlY1eAcSZL8Axn+NY+F8YF0+AsISJS4zlDsZwXs=; b=V0PteE3R9bs4cEzNaJnbed7MZRheAl5sGrKzkC0LxVJjHYXMgoMqF2u8CvoOyFXwRs iPhdmcv1TAeyIgB5AZ+mzyybehHS1TFPlXlRCxYgl42xpiLlOUXCdaVzMr/N5jcAMJWH 1rWbW759H9Lw2E0u311VKUD9dF/hFi1aVns3njyBdyjlGiFehZyjtHj64/zL7PPyEJuP TAXqi39hMNJi+cuy4blodRdYDIQd4r4TVGbpCPQrwS9BgXVRaC7r5LwMDfo6uxfNFtaP bakWMSfFZCO9QpOWBVETExEaqYunFeaTvgKxxK6SfFNxiJP5F10HkDyezKIBFYgFNNXg QhHQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=f5uJT8NK; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-149471-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-149471-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id k8-20020a170902d58800b001ddc90af6c6si993596plh.319.2024.04.18.01.17.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Apr 2024 01:17:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-149471-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=f5uJT8NK; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-149471-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-149471-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 5975B282E71 for ; Thu, 18 Apr 2024 03:31:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 354F0535A2; Thu, 18 Apr 2024 03:31:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="f5uJT8NK" Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (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 9686A4F8B1; Thu, 18 Apr 2024 03:31:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713411077; cv=none; b=q8sZ9SzIJtmUUGlB4IagWoiWhT9z83pXLq5yU4uxWFbpXRKiV9JGoXhsEO/oJO1FjQPYvDxRezgPnQo6dNjNx83X327Qy9NgmYiqyJf4ofp5ckYGtE15Q1/YDNN5XXYTifIa8QmxcHrr88tRbu7AuI1DZ8hMwYo+eInCfcO6MAs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713411077; c=relaxed/simple; bh=qXoQM5IGnLPtSUBvxTTfUhnR1RLIkkTfcm4G9mACIzE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=GPaDTOUKxds5F87Kn4eHo0vGJYDG8aOfH3lK8t45MxAlNZYvN7IOi83hKMYSCupexzHihu9yYp+FBrnXlgHtUt8SiXCFIinWarYpwkI5Jtm6zpbvRikUSIJtv148hllYXrA/a/LgJtDW0mdrUyM9q4CeMlzxZ2ZZRdT9wKR3JKI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=f5uJT8NK; arc=none smtp.client-ip=90.155.50.34 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=infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; 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=Zy7IR3Gvl36ziw9sf2woAp5XWV/QSQ6BNNUf9k7Ge6g=; b=f5uJT8NKu3sNkh/Q0cLgqRlT1O nHg8ZE4rhHPBZv3pwx4O+QYR/31LKzoQkSYScFKaz3jCP2Ur1DlocSMHnCte+iJc3csQxO2sNFY48 B/tr2ChVHbWEwQVGVj9vMsMZv00KnarOc0LAQnr+lnkVgryFI2PNK0/xkZbCGO47UP85T/m3YsKF2 G4DRz3S4nluNFOWMCQnPENCEduyiKAq9gfQcAuiImfdutsxhxW6zFly7KBRR6gKQNlwhj75XKPo1c x42ra0Nyw3kSYLwx965aQP0JMvGZtEqVa7sqN9OJA4BeY9J8eoZDVLM7ty26WZql/8SEl8yclNwd1 +AHw60TA==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1rxIU2-00000004Q7V-43uq; Thu, 18 Apr 2024 03:30:47 +0000 Date: Thu, 18 Apr 2024 04:30:46 +0100 From: Matthew Wilcox To: Barry Song <21cnbao@gmail.com> 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 Subject: Re: [PATCH 7/8] mm: drop page_index/page_file_offset and convert swap helpers to use folio Message-ID: References: <20240417160842.76665-1-ryncsn@gmail.com> <20240417160842.76665-8-ryncsn@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: 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 = folio_file_page(folio, swp_offset(entry)); > mm/swap_state.c <> > return folio_file_page(folio, swp_offset(entry)); > mm/swapfile.c <> > page = 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?