Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2798309yba; Mon, 22 Apr 2019 13:11:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqzZY/c2UKyJSLM+c2fL1rrJEF5Jg2uAXsJdxuGvSJRApBHSfr7h+8iLrmFhJGF3gs7Wipmg X-Received: by 2002:a63:fd49:: with SMTP id m9mr20546218pgj.16.1555963870590; Mon, 22 Apr 2019 13:11:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555963870; cv=none; d=google.com; s=arc-20160816; b=K2m3G7a1lhapYkooMfAxnBQYzZhpOFVYKBsVHh0Vxi+fpVRN11fmmaBroOQjxTfO5E IzwaeYXHSJgTSFVLZqczeTIts7SO+k9V34Hs8yFBJEnYpmhO3THljoxJav6VkcZLarHG CDWT+ZEshR9H7qnk633jNbj1nIyakPBgnN1NPggvdKmfHVrmdJpHB9rlMpkdfVtEKKiM b8o3PckLVAlQQzIWhfPK57A9tesAH/tMWQ3G2Pc+HUmx0bJFhdoaLK9Lh71kKrigRfKd syoX/4Qy6FM0sm3Lxalwra5XmhZLPDpsl9+I0CJ5J6Gv7Y1C0KVchNKUNvzGJGGQFYjT wYhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=OS2hVKKW50ZmouHzSRmPm/efY8EnPT5441lUIE9oysQ=; b=pH0BCj6ywlTWRQniPKqde4IwrD1stuAwRbQoi6fmcWVxWOtHxhY0yfLqRSvXhmg7vL 1eTZopFPl5I4nuf4EKmIqnk4Fpv7+a5a9KzYrLqGpdTZBsz70AeMuUpzCWe19tEHDgD3 p4UNpkFTjpaP0cXtVNvPw4cfx/Rm/Dix8lxVKN8Qj4qSBH9lnUezNKIdgM7uGk8wWFpP 7Vh9aT0VRjz3l5tE1lHV/efEAzKHk95AM3J+FxETdlrc++0o8ftg5/vtNHhsy1WIj0TQ lHvRyg+ajasyjLqjjEMroFNxqwrCIZAYx6VnCXFAykc4RDFc9pxypAtAWBxV0HQu0iUm nyNA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x2si3637975pgf.272.2019.04.22.13.10.54; Mon, 22 Apr 2019 13:11:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732530AbfDVUJt (ORCPT + 99 others); Mon, 22 Apr 2019 16:09:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39460 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729106AbfDVUJr (ORCPT ); Mon, 22 Apr 2019 16:09:47 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1D7CC59468; Mon, 22 Apr 2019 20:09:47 +0000 (UTC) Received: from redhat.com (unknown [10.20.6.236]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6880917CFF; Mon, 22 Apr 2019 20:09:43 +0000 (UTC) Date: Mon, 22 Apr 2019 16:09:36 -0400 From: Jerome Glisse To: Laurent Dufour Cc: akpm@linux-foundation.org, mhocko@kernel.org, peterz@infradead.org, kirill@shutemov.name, ak@linux.intel.com, dave@stgolabs.net, jack@suse.cz, Matthew Wilcox , aneesh.kumar@linux.ibm.com, benh@kernel.crashing.org, mpe@ellerman.id.au, paulus@samba.org, Thomas Gleixner , Ingo Molnar , hpa@zytor.com, Will Deacon , Sergey Senozhatsky , sergey.senozhatsky.work@gmail.com, Andrea Arcangeli , Alexei Starovoitov , kemi.wang@intel.com, Daniel Jordan , David Rientjes , Ganesh Mahendran , Minchan Kim , Punit Agrawal , vinayak menon , Yang Shi , zhong jiang , Haiyan Song , Balbir Singh , sj38.park@gmail.com, Michel Lespinasse , Mike Rapoport , linux-kernel@vger.kernel.org, linux-mm@kvack.org, haren@linux.vnet.ibm.com, npiggin@gmail.com, paulmck@linux.vnet.ibm.com, Tim Chen , linuxppc-dev@lists.ozlabs.org, x86@kernel.org Subject: Re: [PATCH v12 14/31] mm/migrate: Pass vm_fault pointer to migrate_misplaced_page() Message-ID: <20190422200936.GE14666@redhat.com> References: <20190416134522.17540-1-ldufour@linux.ibm.com> <20190416134522.17540-15-ldufour@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190416134522.17540-15-ldufour@linux.ibm.com> User-Agent: Mutt/1.11.3 (2019-02-01) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Mon, 22 Apr 2019 20:09:47 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 16, 2019 at 03:45:05PM +0200, Laurent Dufour wrote: > migrate_misplaced_page() is only called during the page fault handling so > it's better to pass the pointer to the struct vm_fault instead of the vma. > > This way during the speculative page fault path the saved vma->vm_flags > could be used. > > Acked-by: David Rientjes > Signed-off-by: Laurent Dufour Reviewed-by: J?r?me Glisse > --- > include/linux/migrate.h | 4 ++-- > mm/memory.c | 2 +- > mm/migrate.c | 4 ++-- > 3 files changed, 5 insertions(+), 5 deletions(-) > > diff --git a/include/linux/migrate.h b/include/linux/migrate.h > index e13d9bf2f9a5..0197e40325f8 100644 > --- a/include/linux/migrate.h > +++ b/include/linux/migrate.h > @@ -125,14 +125,14 @@ static inline void __ClearPageMovable(struct page *page) > #ifdef CONFIG_NUMA_BALANCING > extern bool pmd_trans_migrating(pmd_t pmd); > extern int migrate_misplaced_page(struct page *page, > - struct vm_area_struct *vma, int node); > + struct vm_fault *vmf, int node); > #else > static inline bool pmd_trans_migrating(pmd_t pmd) > { > return false; > } > static inline int migrate_misplaced_page(struct page *page, > - struct vm_area_struct *vma, int node) > + struct vm_fault *vmf, int node) > { > return -EAGAIN; /* can't migrate now */ > } > diff --git a/mm/memory.c b/mm/memory.c > index d0de58464479..56802850e72c 100644 > --- a/mm/memory.c > +++ b/mm/memory.c > @@ -3747,7 +3747,7 @@ static vm_fault_t do_numa_page(struct vm_fault *vmf) > } > > /* Migrate to the requested node */ > - migrated = migrate_misplaced_page(page, vma, target_nid); > + migrated = migrate_misplaced_page(page, vmf, target_nid); > if (migrated) { > page_nid = target_nid; > flags |= TNF_MIGRATED; > diff --git a/mm/migrate.c b/mm/migrate.c > index a9138093a8e2..633bd9abac54 100644 > --- a/mm/migrate.c > +++ b/mm/migrate.c > @@ -1938,7 +1938,7 @@ bool pmd_trans_migrating(pmd_t pmd) > * node. Caller is expected to have an elevated reference count on > * the page that will be dropped by this function before returning. > */ > -int migrate_misplaced_page(struct page *page, struct vm_area_struct *vma, > +int migrate_misplaced_page(struct page *page, struct vm_fault *vmf, > int node) > { > pg_data_t *pgdat = NODE_DATA(node); > @@ -1951,7 +1951,7 @@ int migrate_misplaced_page(struct page *page, struct vm_area_struct *vma, > * with execute permissions as they are probably shared libraries. > */ > if (page_mapcount(page) != 1 && page_is_file_cache(page) && > - (vma->vm_flags & VM_EXEC)) > + (vmf->vma_flags & VM_EXEC)) > goto out; > > /* > -- > 2.21.0 >