From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 25FF5C433DB for ; Mon, 1 Feb 2021 22:18:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D0C2464D9D for ; Mon, 1 Feb 2021 22:18:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229783AbhBAWS1 (ORCPT ); Mon, 1 Feb 2021 17:18:27 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:51224 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229554AbhBAWS0 (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-qt1-f198.google.com (mail-qt1-f198.google.com [209.85.160.198]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-566-ecR_2NJoNdmiqL5NGe-P7Q-1; Mon, 01 Feb 2021 17:16:58 -0500 X-MC-Unique: ecR_2NJoNdmiqL5NGe-P7Q-1 Received: by mail-qt1-f198.google.com with SMTP id k90so11658273qte.4 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=TR2Gs4Dls3u04KW0bC3+LY/7/HN78nI6yQUc9KQHFUWBiQlRpjqsunca5VRCvxVs45 RhVYLOGHF627rTjp0W9xfsBhf71n3ee7WER6XtflIRqy4idTYtS3yz3Y3BlmmFBHkDXf dAEP/hQDuSUEXYQ5v8lkMaXW2AeIt4xPlrd7vKwr3nC6AkIujQKH7fF3MGZgrFs/fCP1 K4gXQVbEnL68lyym8dWJZO2QuTwVPotlHMOwAdQTh7thp6k9LU6pRd0iv2UwrMv5XVOu zF2/XVe9dvvmoLGPeVJPi6A7smSGF3JR8xk5hHiB6q1DDqb/cajPmqskXYGz/JHJJWM+ JfPQ== X-Gm-Message-State: AOAM530TYDrNEaUTPHfYa5mqTMzRrJeevJmBQUbjybMP7QEQ/q94YOHR vYwT/8hO45fOz9QBIB7VD2j53EgT3zcRyIXZ/uwqumWMSHJjqX6r1h8BIsMEmE6lwTMw1slhWMT UGEs+8NpjAgSOu0TfhdPVuedL2A== X-Received: by 2002:a37:8fc3:: with SMTP id r186mr18916811qkd.253.1612217817875; Mon, 01 Feb 2021 14:16:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJycp08TqePZIDEQY1l41O7S1IZiWlSToWvexBdN5xDvx00e6QmbaZ+OIJcb0uui1HUWN1gXZA== 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-fsdevel@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