Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp4162953pxb; Mon, 1 Feb 2021 14:20:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJwn0QT4Q8132Rg1Ml6Yj0owjHM19QmB0vB1oCohWtm6gSdiindrEjyXM+a5i1h1zA+bVpGN X-Received: by 2002:aa7:d452:: with SMTP id q18mr11376875edr.350.1612218001121; Mon, 01 Feb 2021 14:20:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612218001; cv=none; d=google.com; s=arc-20160816; b=NHb9eSVxZEdgZyCzPmZf7AFtAeqtdXF3JeJBMROgBTt8W2bbg46Wg/Wl1NBYLMDBub XSIn+P+rrUQVwxHLtFfl/bJYmfe96ZzBQl2HgofSTPX5pbS3ner0IGW2IoZjFa6hwbsZ jfSHdTjROg12amXZFBjjpOb67AvT/zql8jQdR0mI+CwGjnzFmqRM+vODr2tG2aaQD+Uk vfB/ILPNDPfn1+qLs+clFQfYSauMEfVO/9ps5N4Ec8uoADy1arv7bdFLF9SnV0CM3B6J V+28d/X0bTZGt9Jl2qtuUqnPclqZSQonqsMPs4WNRciTHkjQFMLRoifslPX6nWQu8VnE w1jA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=xmN+agXqiROkkYz5Om/OjbH0Pxuwyb0SEcLP3k/Y+SI=; b=oV1fi7lCJmE7f09Rrh8Ssr3UP/XuUW50f2nVZB2iulTFX1JDyV8mb6iFthIWRpbvFM dKiP3WSOXxXs/yK6jLtIC3eGk0HiXPJ1lhviVsJaeVqM19KsP+J0cfun8+JWZuUrgPaW PjsapTo5XbgV0yjs4qYEp0uEVuiDDYb2a5VJyXWLI5koYgOTHmpZiIO/DyQHq1+GQ+S0 R595SySrwKbs7lMm4uCHktvZjwLWUUok00tzvL0J/iWZfMzVdqBiAfoN08G2bThoPJHQ Yv1ia6Q4BkgWdyxv5bwCYg3C0clMXEfd0fqN8Vzpnf6n6eGCIzLfksruC9vn11R9Zu9J kHKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=VsqAu0sS; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a12si11824110edk.285.2021.02.01.14.19.37; Mon, 01 Feb 2021 14:20:01 -0800 (PST) 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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=VsqAu0sS; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229810AbhBAWS1 (ORCPT + 99 others); Mon, 1 Feb 2021 17:18:27 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:36073 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229543AbhBAWS0 (ORCPT ); Mon, 1 Feb 2021 17:18:26 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612217819; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=xmN+agXqiROkkYz5Om/OjbH0Pxuwyb0SEcLP3k/Y+SI=; b=VsqAu0sSesPxo2FxXRQMunX7YJeMcbKX4Ozqk1gGog6dbYXqYZvg6K+oLFWh7RwL2UCkQl fxCR9zt7nZqi28ADR9Orawz2z7ScziRtKyE5RhrqDxUI4vXOmZfjvrsuzdkChCuxIbsqj4 Iw69Nmqc/rC9sFi9uwKBkbsqnkERUBk= Received: from mail-qv1-f71.google.com (mail-qv1-f71.google.com [209.85.219.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-82-iTLUGkTdPEq5vU64fG3rmw-1; Mon, 01 Feb 2021 17:16:58 -0500 X-MC-Unique: iTLUGkTdPEq5vU64fG3rmw-1 Received: by mail-qv1-f71.google.com with SMTP id h13so12325237qvo.18 for ; Mon, 01 Feb 2021 14:16:58 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=xmN+agXqiROkkYz5Om/OjbH0Pxuwyb0SEcLP3k/Y+SI=; b=DAfF83hb8pUW7LEMvlvI0vKjVBrElQxJhbX32Dn9uHp8vp5Mk4lqwmURTJ/wfAeGy+ tRQnitbPMdKa03tthPxWC4EZPZ9sVbUW06uudewISSZfKWuM3ZPd9m5Ucz7LArvduD3w XHyNoZ8Y1pH7zKjih94TPgie5riNK7Y1TS5WWrGFk1ruQ/phofFuvEyU8HP8eogDvGPl 0QTSrTGiZOBNMPA+0gdo44MY1r8QfCxGEMQQs33gm44j6bK0opnWvmbiSjXXePzKRVs/ s2DaSO3Xmh5j4AArHH9waeEE/DmAi2qElT8Sg87pKR9Kob2INucce0nQAqDJIOWKqa6o nt4Q== X-Gm-Message-State: AOAM5303jwspPelSYRQ3wqw/gSuRg9Xhe2S5XZZdxKItCHWxNirJWEAF a6FtTeYX7DC18dd+pUFy8gTHCx15GkzlIMjE+v74hpOrmsIG7wXNiRy4lxPNFoDUSYcwSW1Escz cfyg9Oe3eSod4IzH8GftuIT5F X-Received: by 2002:a37:8fc3:: with SMTP id r186mr18916805qkd.253.1612217817874; Mon, 01 Feb 2021 14:16:57 -0800 (PST) X-Received: by 2002:a37:8fc3:: with SMTP id r186mr18916780qkd.253.1612217817592; Mon, 01 Feb 2021 14:16:57 -0800 (PST) Received: from xz-x1 ([142.126.83.202]) by smtp.gmail.com with ESMTPSA id m202sm2009463qke.24.2021.02.01.14.16.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Feb 2021 14:16:56 -0800 (PST) Date: Mon, 1 Feb 2021 17:16:54 -0500 From: Peter Xu To: Mike Kravetz Cc: Axel Rasmussen , Alexander Viro , Alexey Dobriyan , Andrea Arcangeli , Andrew Morton , Anshuman Khandual , Catalin Marinas , Chinwen Chang , Huang Ying , Ingo Molnar , Jann Horn , Jerome Glisse , Lokesh Gidra , "Matthew Wilcox (Oracle)" , Michael Ellerman , Michal =?utf-8?Q?Koutn=C3=BD?= , Michel Lespinasse , Mike Rapoport , Nicholas Piggin , Shaohua Li , Shawn Anastasio , Steven Rostedt , Steven Price , Vlastimil Babka , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, Adam Ruprecht , Cannon Matthews , "Dr . David Alan Gilbert" , David Rientjes , Oliver Upton Subject: Re: [PATCH v4 1/9] hugetlb: Pass vma into huge_pte_alloc() Message-ID: <20210201221654.GJ260413@xz-x1> References: <20210128224819.2651899-2-axelrasmussen@google.com> <20210128234242.2677079-1-axelrasmussen@google.com> <67fc15f3-3182-206b-451b-1622f6657092@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 01, 2021 at 01:53:14PM -0800, Mike Kravetz wrote: > On 2/1/21 1:38 PM, Mike Kravetz wrote: > > On 1/28/21 3:42 PM, Axel Rasmussen wrote: > >> From: Peter Xu > >> > >> It is a preparation work to be able to behave differently in the per > >> architecture huge_pte_alloc() according to different VMA attributes. > >> > >> Signed-off-by: Peter Xu > >> [axelrasmussen@google.com: fixed typo in arch/mips/mm/hugetlbpage.c] > >> Signed-off-by: Axel Rasmussen > >> --- > >> arch/arm64/mm/hugetlbpage.c | 2 +- > >> arch/ia64/mm/hugetlbpage.c | 3 ++- > >> arch/mips/mm/hugetlbpage.c | 4 ++-- > >> arch/parisc/mm/hugetlbpage.c | 2 +- > >> arch/powerpc/mm/hugetlbpage.c | 3 ++- > >> arch/s390/mm/hugetlbpage.c | 2 +- > >> arch/sh/mm/hugetlbpage.c | 2 +- > >> arch/sparc/mm/hugetlbpage.c | 2 +- > >> include/linux/hugetlb.h | 2 +- > >> mm/hugetlb.c | 6 +++--- > >> mm/userfaultfd.c | 2 +- > >> 11 files changed, 16 insertions(+), 14 deletions(-) > > > > Sorry for the delay in reviewing. > > > > huge_pmd_share() will do a find_vma() to get the vma. So, it would be > > 'possible' to not add an extra argument to huge_pmd_alloc() and simply > > do the uffd_disable_huge_pmd_share() check inside vma_shareable. This > > would reduce the amount of modified code, but would not be as efficient. > > I prefer passing the vma argument as is done here. > > > > Reviewed-by: Mike Kravetz > > > Another thought. > > We should pass the vma to huge_pmd_share to avoid the find_vma. Agreed. Seems not relevant to this series, but should be a very nice add-on after this patch can land. Thanks, -- Peter Xu