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=-11.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 780ADC433E6 for ; Tue, 2 Feb 2021 20:39:08 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 0C44664E3F for ; Tue, 2 Feb 2021 20:39:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0C44664E3F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 4852C6B0005; Tue, 2 Feb 2021 15:39:07 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 4357A6B0006; Tue, 2 Feb 2021 15:39:07 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2FEC76B006C; Tue, 2 Feb 2021 15:39:07 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0135.hostedemail.com [216.40.44.135]) by kanga.kvack.org (Postfix) with ESMTP id 1615A6B0005 for ; Tue, 2 Feb 2021 15:39:07 -0500 (EST) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id C382E3630 for ; Tue, 2 Feb 2021 20:39:06 +0000 (UTC) X-FDA: 77774492292.13.unit60_5b0caa5275cd Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin13.hostedemail.com (Postfix) with ESMTP id A462718140B7B for ; Tue, 2 Feb 2021 20:39:06 +0000 (UTC) X-HE-Tag: unit60_5b0caa5275cd X-Filterd-Recvd-Size: 4955 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by imf33.hostedemail.com (Postfix) with ESMTP for ; Tue, 2 Feb 2021 20:39:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612298344; 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=cxKILuRnLUyJm7OjpO6X1TfMyhzRQAP6Snl2wpeGcYk=; b=cznVD3XbfRkfW4bT46H2F9kphlNQYtuFXV/u8JiIqD5o1d8GJX6BihTXY7pbQ0LFyo1p9g 3Tri4y7Pi1Q36wfu5CZLN05Cv+VfpA65tLDHO55MmyT3aVRN31Sle8tlxLmGfZ28kypaDf 6dVgMfVzOFKTIPvD3GB7MxSQs1/fBSo= 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-502-AdYIUNzSOQWWNfgdxlwjnw-1; Tue, 02 Feb 2021 15:39:01 -0500 X-MC-Unique: AdYIUNzSOQWWNfgdxlwjnw-1 Received: by mail-qt1-f198.google.com with SMTP id i1so7703900qtp.16 for ; Tue, 02 Feb 2021 12:39:01 -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=cxKILuRnLUyJm7OjpO6X1TfMyhzRQAP6Snl2wpeGcYk=; b=J1iipCF7LHWVDgWzC8VD/h8oT0FemzA5I5i06eLCRS2v+dM97tuGJ8CuAa0jjWpYwT YGNSccpf4iZKWCcYvY7BGrPfDOxU6gPPJvw6HZva+b1whDA2i3C9SVDyNHQcge30w8bW ABOqkB+rAfd4moYq+Cct/kgP/0KtnxKqjlTDU011ojjwDHdPjPPhmHaW3FmvBzOfgVCH r2OT74HYlC2pfORT3zBvH+Sze80KTONiUXO6QrpGmNNY61d5sq1q3V2se6wEjySdR2hC ic0JuDG/SMcqdIaaOXcYvyBghRqGjU5d28mypoLi6E09YOnLyFac51z5YPFcX6inmvD/ TOBQ== X-Gm-Message-State: AOAM5320lJ5NAJYADTGKAw9rXORCl/y0M+9xu6sHzSpHW8RVUWpJHruY Qx1rd28+DFqZ36y26061pfHcwZZx4kfBAQSXmZXj79bnzkrJTqprcxFccvcpSExDBlfOW23oQX+ i8ilSRqJt5tc= X-Received: by 2002:a05:6214:913:: with SMTP id dj19mr22417091qvb.33.1612298341427; Tue, 02 Feb 2021 12:39:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJyafFtJVqxfl3ZVONklJT+TkO26nkgrl/XIOWV4Fo8YGYJICgDvYe1YdGqwsJUmu7Uzfhqvhw== X-Received: by 2002:a05:6214:913:: with SMTP id dj19mr22417072qvb.33.1612298341170; Tue, 02 Feb 2021 12:39:01 -0800 (PST) Received: from xz-x1 (bras-vprn-toroon474qw-lp130-20-174-93-89-182.dsl.bell.ca. [174.93.89.182]) by smtp.gmail.com with ESMTPSA id s23sm33984qke.3.2021.02.02.12.38.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Feb 2021 12:39:00 -0800 (PST) Date: Tue, 2 Feb 2021 15:38:59 -0500 From: Peter Xu To: Axel Rasmussen Cc: Andrea Arcangeli , Andrew Morton , Mike Kravetz , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] userfaultfd: hugetlbfs: only compile UFFD helpers if config enabled Message-ID: <20210202203859.GH6468@xz-x1> References: <20210202203127.3596707-1-axelrasmussen@google.com> MIME-Version: 1.0 In-Reply-To: <20210202203127.3596707-1-axelrasmussen@google.com> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=peterx@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline X-Bogosity: Ham, tests=bogofilter, spamicity=0.000108, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue, Feb 02, 2021 at 12:31:27PM -0800, Axel Rasmussen wrote: > For background, mm/userfaultfd.c provides a general mcopy_atomic > implementation. But some types of memory (e.g., hugetlb and shmem) need > a slightly different implementation, so they provide their own helpers > for this. In other words, userfaultfd is the only caller of this > function. > > This patch achieves two things: > > 1. Don't spend time compiling code which will end up never being > referenced anyway (a small build time optimization). > > 2. In future patches (e.g. [1]), we plan to extend the signature of > these helpers with UFFD-specific state (e.g., enums or structs defined > conditionally in userfaultfd_k.h). Once this happens, this patch will be > needed to avoid build errors (or, we'd need to define more UFFD-only > stuff unconditionally, which seems messier to me). > > Peter Xu suggested this be sent as a standalone patch, in the mailing > list discussion for [1]. > > [1] https://patchwork.kernel.org/project/linux-mm/list/?series=424091 > > Signed-off-by: Axel Rasmussen I meant a standalone patch along with the next version of your series would be good enough... :) If Mike is fine I won't complain if you'd squashed it into that patch either. The patch itself looks correct to me. Reviewed-by: Peter Xu Thanks, -- Peter Xu