Received: by 2002:a05:7412:798b:b0:fc:a2b0:25d7 with SMTP id fb11csp108788rdb; Wed, 21 Feb 2024 19:42:02 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWkhggKMGLlZgm/2JukgvZ67IxMNHQh/glVWXB6bx1Tp8VvPYEv5PZs/yfP1XDa5FT4LqDJ5SMMy0EDiV1QNtn0WGQgwEA3q0urDDUq4Q== X-Google-Smtp-Source: AGHT+IEgBXN6Q7VkP7eT6lOyo/lt0ruuxHO+fuSc6GqyG/LkWe7P2L4wNd//ity2aFpS9WERc0qv X-Received: by 2002:a05:6358:731a:b0:17b:6171:ada5 with SMTP id d26-20020a056358731a00b0017b6171ada5mr3299820rwg.19.1708573322354; Wed, 21 Feb 2024 19:42:02 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708573322; cv=pass; d=google.com; s=arc-20160816; b=ZMh9PfdfyYWHbCLO2PaW82aBwimXKdj80/pBqTYUXaUYZAI96hz7fRa8P/NJ4sduNB Lvac63eacrdP72HlTiSygnhjHfPR3tBL5asjxrO4a7Aor0wMvU5ohD4kqc5/FnxeogqQ 5oDBuCqBj9JUZDm3+OwM3sMQoCmjZTqb8ldUsQoCYrK1qXTicGfq0hOU31LQDrxEWUH3 oXK+YqkKGC4vjkonNmrxXYJN4o5599yKlAFK0ASbVOmCVKAJM0yCtSrmSCA0SiMewVzx g1HQpdyIwcPqAFidbmxV+ZzNa1RgpqWvC2JWBBmhYbuyJVqSt2zeIsDvf5vNF5c7veMx //fw== 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=e9Kb7+9juqy5FhJMaaMa784eYLFmC0FDrVU0K/noLKM=; fh=7LP8t954uHnDkzu77Iidc1+r0eNDQrtruu0dALQ6seI=; b=z1u+SI+NuxwEZoimoy8R1Oiumvmih8H+RjfScR/2018NaXc/eVYNFb4PQbc9uIpLWc ry5zRsCDHAxqkhBOPwvEY8TWpa16ry+NjJ/c/9LOiJdBZYaC+mJO+bhQ8otihk2QvA9M yDx6sn6PppNgAbKn1TQmCf71041X0y4Ua8Yz958nRhh0xd+i8JZg4auzIlYtG8hWlKYW Sg0f8ofT4/JBjEKCbSoarsbTUCuQDz3ZQevtbLMrInymods4L6xwYHU8MgrwWR23AjVE yd8LiYuCDAatLFrrMR+si4wbxko8g6k+sW468Gkw8wGJ850RHFVn36NddSQ+XTWs0KAd GkPg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=RmuIeskV; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-75865-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-75865-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id 71-20020a63004a000000b005cd8b5dfe9csi9669437pga.491.2024.02.21.19.42.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Feb 2024 19:42:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-75865-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=RmuIeskV; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-75865-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-75865-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id EB1FCB2410A for ; Thu, 22 Feb 2024 03:41:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 45A2B1755B; Thu, 22 Feb 2024 03:41:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="RmuIeskV" 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 E1F1B14296 for ; Thu, 22 Feb 2024 03:41:50 +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=1708573312; cv=none; b=sd3Vz+euREv8RgY1hPH8GfjHfNXoGrbZ8D0x6vDJCBd7nnw6PEK0ZiQrPx8eXng+w1B8Kt1BwiQvVhUTZvxkTe9MIxGC904QNxdehSYoKmgSIpJI/TiVYyZSGNhI/8HMD3L+CFiOlVZFMqKipM4JqCE94owIh3Vbp5ak6kNP5J0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708573312; c=relaxed/simple; bh=1ulRBrYzQdOmihVOfbwMuFBbUbV59yc+rUQ7cABoEHs=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=H5jk0OSWxTykrxUskM8lqQHjFYwjolmMwCvXElXBJkxuwOPlbBpveUGiYhVehAwSWlh+133OMIsoTFbaXVVYgDYVkP3K02jCYJO0hrEFCKMN4T5tdzGcFvW6ZCsJjxzN0Azki+8HM5dy90D9offd8b0FKruetlQFb1QyJ2Vedt8= 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=RmuIeskV; 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=e9Kb7+9juqy5FhJMaaMa784eYLFmC0FDrVU0K/noLKM=; b=RmuIeskVf1E2Kxz6/IxeCqW04N CrbDilGBItIwOekuLDghEjj2hDdun5rXc3L4bAfOV99PtDvb67Mf1ba7arpix6VXSnbs00G6mssY5 nlD564ezWwhpmki+hHXLXeBn54a2r/lbeEQH/3+s7amcsl4nSNK6LSDKLDC5M8Zdh0itiqeQ7nG5D x8HgU2+kJhxsR9SNjgXwWwkEiJFy2ugsGThnhoDc7OjyDsLMZDF2/V+mFLt/yQl08do2cPbXKpJ7D +4Zqr/hAW8DYfRg6rUvXFK9Mx/nfM2T0ObcCtOIFnrH1RRtnaT97Zeo2AScvocj+WF4jPFTjQ93rR qxEMcOsw==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1rczy0-00000002UCI-2zDG; Thu, 22 Feb 2024 03:41:48 +0000 Date: Thu, 22 Feb 2024 03:41:48 +0000 From: Matthew Wilcox To: "Vishal Moola (Oracle)" Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, akpm@linux-foundation.org, muchun.song@linux.dev Subject: Re: [PATCH v2 3/5] hugetlb: Pass struct vm_fault through to hugetlb_handle_userfault() Message-ID: References: <20240221234732.187629-1-vishal.moola@gmail.com> <20240221234732.187629-4-vishal.moola@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: <20240221234732.187629-4-vishal.moola@gmail.com> On Wed, Feb 21, 2024 at 03:47:30PM -0800, Vishal Moola (Oracle) wrote: > Now that hugetlb_fault() has a struct vm_fault, have > hugetlb_handle_userfault() use it instead of creating one of its own. > > This lets us reduce the number of arguments passed to > hugetlb_handle_userfault() from 7 to 3, cleaning up the code and stack. > > Signed-off-by: Vishal Moola (Oracle) > --- > mm/hugetlb.c | 38 +++++++++----------------------------- > 1 file changed, 9 insertions(+), 29 deletions(-) I love the look of this ... > @@ -6116,7 +6098,8 @@ static vm_fault_t hugetlb_no_page(struct mm_struct *mm, > struct vm_area_struct *vma, > struct address_space *mapping, pgoff_t idx, > unsigned long address, pte_t *ptep, > - pte_t old_pte, unsigned int flags) > + pte_t old_pte, unsigned int flags, > + struct vm_fault *vmf) Should we remove vma, address, idx and flags?