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=-18.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL 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 39CAEC433DB for ; Thu, 18 Feb 2021 20:35:34 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id AAEBB6024A for ; Thu, 18 Feb 2021 20:35:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AAEBB6024A Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 0B2126B0006; Thu, 18 Feb 2021 15:35:33 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 065536B006C; Thu, 18 Feb 2021 15:35:32 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EBA4C6B006E; Thu, 18 Feb 2021 15:35:32 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0037.hostedemail.com [216.40.44.37]) by kanga.kvack.org (Postfix) with ESMTP id D5D9B6B0006 for ; Thu, 18 Feb 2021 15:35:32 -0500 (EST) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 9891B181AF5FA for ; Thu, 18 Feb 2021 20:35:32 +0000 (UTC) X-FDA: 77832544104.26.3C34BC9 Received: from mail-io1-f46.google.com (mail-io1-f46.google.com [209.85.166.46]) by imf18.hostedemail.com (Postfix) with ESMTP id 8723D20001F2 for ; Thu, 18 Feb 2021 20:35:32 +0000 (UTC) Received: by mail-io1-f46.google.com with SMTP id u8so3361166ior.13 for ; Thu, 18 Feb 2021 12:35:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=nbAEG2PifLQ/VqMicX/G7j56UYCqmvzR+QI2lQowe2A=; b=IqbSvbDFA0ZhYx6Yp4mSkEQzRdoLP9FBgpXdaG9uKeVHmJuEWzUs+K5XmX4LxSKWcL IrUZv/Ksp2L+fGJPS3/2i9YBCvwpN/nAzeF2qiG0U2qwAxjahEUxNx8m/c+8l9iP7FoK e1V/0ZRQpXAseW/mNSe5AXTCqtIbjnWmDaN/dxT8DzSEXGtAv56xXKM6F9480NyADYpi 80lnYdj2miubYgoBD6HcIwX33zvCV9wrPk+VN+qMX7J/hKlkYBCBoxDNgDUQs641lGzQ vQ1oC6TC0c/ABk1+kFk65R+4x0t4+mofitgRn40e2hNZsY/q4ZaLzo7lo9VpFNoQF/48 Y19Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=nbAEG2PifLQ/VqMicX/G7j56UYCqmvzR+QI2lQowe2A=; b=Ix/LGEPTiI3ntM+AgNj6QA5tuD+QyUo4z5D9jAx5MJYO6dVn9Ap8vH7XChASRnB6Gx DbWTzepvgQOO9nwQrrQqqtxl2/HqlfLqsO2yqBHudO9zs/YhUeOZWhQu6Yy4W2V9OHmz teiQJA/lKLKva7vQReqtZ0DFghAGCNiL2WOYDHo8d+sVuabRIjYzgMsrZp51aqN8NfIK MSglb7iouzK0xbsoEaa+zaXRwQ64q54MFTCMABa/2EPh/Obs1UgrKAdwnlx+rYFVRchX tjldWKqOvOfWz9LeVHAg3gfSTO5C26L4PN3LPiK3DXg1WUjnXr6bibbC+Pfwv6xQBqrx 5+CA== X-Gm-Message-State: AOAM532d3x5/wVHPCl5KI6ieWc31FiggV4BwlihEFXFKiHPwd4bOr7K1 CRBsFFl6Kq8HKx9eAdENYD8d4J4npzCl3PigK6uY5A== X-Google-Smtp-Source: ABdhPJyWjZ08w2Fog4XJ/edAAhQEhBdT/movvv7vnvK1QF0dLxKTJQLwBbWm4fK0pcrmqL2aOOKubLvFun3le37zzII= X-Received: by 2002:a02:6911:: with SMTP id e17mr3303786jac.99.1613680531165; Thu, 18 Feb 2021 12:35:31 -0800 (PST) MIME-Version: 1.0 References: <20210217204418.54259-1-peterx@redhat.com> <20210217204619.54761-1-peterx@redhat.com> <20210217204619.54761-3-peterx@redhat.com> <20210218203214.GD108961@xz-x1> In-Reply-To: <20210218203214.GD108961@xz-x1> From: Axel Rasmussen Date: Thu, 18 Feb 2021 12:34:55 -0800 Message-ID: Subject: Re: [PATCH v2 4/4] hugetlb/userfaultfd: Unshare all pmds for hugetlbfs when register wp To: Peter Xu Cc: Linux MM , LKML , Mike Kravetz , Mike Rapoport , Andrea Arcangeli , Matthew Wilcox , "Kirill A . Shutemov" , Andrew Morton Content-Type: text/plain; charset="UTF-8" X-Stat-Signature: k1mfbzrafpwqf14ppyuny9eu9dmrmgbs X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 8723D20001F2 Received-SPF: none (google.com>: No applicable sender policy available) receiver=imf18; identity=mailfrom; envelope-from=""; helo=mail-io1-f46.google.com; client-ip=209.85.166.46 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1613680532-645071 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, Feb 18, 2021 at 12:32 PM Peter Xu wrote: > > On Thu, Feb 18, 2021 at 10:32:00AM -0800, Axel Rasmussen wrote: > > > @@ -1448,6 +1449,9 @@ static int userfaultfd_register(struct userfaultfd_ctx *ctx, > > > vma->vm_flags = new_flags; > > > vma->vm_userfaultfd_ctx.ctx = ctx; > > > > > > + if (is_vm_hugetlb_page(vma) && uffd_disable_huge_pmd_share(vma)) > > > + hugetlb_unshare_all_pmds(vma); > > > > This line yields the following error, if building with: > > # CONFIG_CMA is not set > > > > ./fs/userfaultfd.c:1459: undefined reference to `hugetlb_unshare_all_pmds' > > Ouch.. Axel, you mean CONFIG_HUGETLBFS rather than CONFIG_CMA, am I right? Surprisingly no, there's a "#ifdef CONFIG_CMA" line ~100 lines above where hugetlb_unshare_all_pmds is defined in hugetlb.c which causes this. My guess is that putting the function inside that block was accidental and it can just be moved. > > -- > Peter Xu >