Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1584722pxj; Wed, 19 May 2021 09:10:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxgtbg/5NG5Kc/1HkQ4j1W243PHV8+AKdV9HtTh/wx2Y7529SuBleoiFa+GMHYUXE0jAfxF X-Received: by 2002:a17:906:c7d2:: with SMTP id dc18mr13819201ejb.188.1621440625352; Wed, 19 May 2021 09:10:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621440625; cv=none; d=google.com; s=arc-20160816; b=M7HJ/7fqDUeRV9gm0prvBs1lsaiImAfNhNDuCQNcUhb+SAmBemWhqOFHljlHuli7dp zRcT/S/C8wyMgr3/HnHxHIOKBm5hasepAml4VrB8OhVyV+otcwYLu5J48Tyk4XQWGRPS CNP9QUrbMasi5egi+y5HTL6onvnAtYPA5yitxlLkTLXQySgMSOFGXaVSycQBHUFLpoXF hI7ot7+ui2Ky22B08wYRQRUEYxipauTxQ2S27s6KIu26yQOEqPRKTkESAXdgiUou/pL1 fQ0K1m+IE4o5Vj9jyccpDEEJ4DL2L/6zfDBxdElN02/11vY+kjEDFMEl0TP/ogkr6hj1 MLNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=lG8WjQEg4WFLJwPqZ6bec6sgIiUix+MF/wJUeydawf8=; b=katXijxFcv1Th7nCmHZr0PmEeROByvyqVukggZg+pT2vWeqcTb9fNh6jJWyyteqVP4 YFe4SJHo5urSisX8lrgORGjHpge2uPGiGdSOqcORLh+1CpNnNVks60I3rK34MaTbugaP U87DUxzWEwZRC7Vj0fFvsUGOYXhq0OM0zG1J51uJMBBFGK+dlV+QR7h7hlT6X2z5UgHx CSihz2SrswWGZ7kUPS9jlPFGshVbE0BackIxliPtM+iJMmuCqpjiuPQWW68VoZ3cic8e EGp7CL4ROHj6qKtIE56xM0xRlOXAgV71WZErofmAjTRIsRb+gz/6W7wX8lviUo5TBhtp 58ew== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y2si5099038edm.360.2021.05.19.09.09.38; Wed, 19 May 2021 09:10:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242334AbhERHhk (ORCPT + 99 others); Tue, 18 May 2021 03:37:40 -0400 Received: from mx2.suse.de ([195.135.220.15]:37158 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242101AbhERHhj (ORCPT ); Tue, 18 May 2021 03:37:39 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 64836AAFD; Tue, 18 May 2021 07:36:21 +0000 (UTC) Date: Tue, 18 May 2021 08:36:18 +0100 From: Mel Gorman To: Yang Shi Cc: "Kirill A. Shutemov" , Zi Yan , Michal Hocko , Huang Ying , Hugh Dickins , Gerald Schaefer , hca@linux.ibm.com, gor@linux.ibm.com, borntraeger@de.ibm.com, Andrew Morton , Linux MM , linux-s390@vger.kernel.org, Linux Kernel Mailing List Subject: Re: [v2 PATCH 1/7] mm: memory: add orig_pmd to struct vm_fault Message-ID: <20210518073618.GA3672@suse.de> References: <20210413212416.3273-1-shy828301@gmail.com> <20210413212416.3273-2-shy828301@gmail.com> <20210517150922.GU3672@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 17, 2021 at 12:39:49PM -0700, Yang Shi wrote: > On Mon, May 17, 2021 at 8:09 AM Mel Gorman wrote: > > > > On Tue, Apr 13, 2021 at 02:24:10PM -0700, Yang Shi wrote: > > > Add orig_pmd to struct vm_fault so the "orig_pmd" parameter used by huge page > > > fault could be removed, just like its PTE counterpart does. > > > > > > Signed-off-by: Yang Shi > > > > > > > > > > > > diff --git a/include/linux/mm.h b/include/linux/mm.h > > > index 25b9041f9925..9c5856f8cc81 100644 > > > --- a/include/linux/mm.h > > > +++ b/include/linux/mm.h > > > @@ -547,6 +547,9 @@ struct vm_fault { > > > * the 'address' > > > */ > > > pte_t orig_pte; /* Value of PTE at the time of fault */ > > > + pmd_t orig_pmd; /* Value of PMD at the time of fault, > > > + * used by PMD fault only. > > > + */ > > > > > > struct page *cow_page; /* Page handler may use for COW fault */ > > > struct page *page; /* ->fault handlers should return a > > > > Could this be a union? > > Do you mean orig_pte and orig_pmd, or cow_page and page? orig_pte and orig_pmd given that one for PTE faults and one is for PMD faults and it's very unlikely they would both need to be considered during a single fault. -- Mel Gorman SUSE Labs