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=-15.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,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 B42D4C433DB for ; Thu, 21 Jan 2021 18:52:43 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 40BBB23136 for ; Thu, 21 Jan 2021 18:52:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 40BBB23136 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 A01A56B0006; Thu, 21 Jan 2021 13:52:42 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 9B0F66B0007; Thu, 21 Jan 2021 13:52:42 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 82A966B0008; Thu, 21 Jan 2021 13:52:42 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0004.hostedemail.com [216.40.44.4]) by kanga.kvack.org (Postfix) with ESMTP id 689AD6B0006 for ; Thu, 21 Jan 2021 13:52:42 -0500 (EST) Received: from smtpin16.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 314EE8249980 for ; Thu, 21 Jan 2021 18:52:42 +0000 (UTC) X-FDA: 77730678564.16.berry75_37067e727565 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin16.hostedemail.com (Postfix) with ESMTP id E79DF100E6903 for ; Thu, 21 Jan 2021 18:52:41 +0000 (UTC) X-HE-Tag: berry75_37067e727565 X-Filterd-Recvd-Size: 5758 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by imf05.hostedemail.com (Postfix) with ESMTP for ; Thu, 21 Jan 2021 18:52:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1611255160; 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=9dViudQ3lb05x7W07+1rvaBJLRkqsQmlwfw0YFNbKhk=; b=BpEeqfSdtNWjkGJT1lcgQww192T9k9MXFZ79lkfKD5Kdloikpe42RkbzDimhNUQ31s5R4C m/tmLwEOXlz31rZfMjCKzC16MSQ4Slwr2RSMp23dpMtJgmR0sDAX7BCVAbS5XUjwwnRxIN eEsW72kFmUukZwOspUDR+VZlV7twTHg= Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-563-cbvLGJLlPTmv82Db1niddg-1; Thu, 21 Jan 2021 13:52:33 -0500 X-MC-Unique: cbvLGJLlPTmv82Db1niddg-1 Received: by mail-qk1-f197.google.com with SMTP id p185so2307543qkc.9 for ; Thu, 21 Jan 2021 10:52:33 -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=9dViudQ3lb05x7W07+1rvaBJLRkqsQmlwfw0YFNbKhk=; b=uZuyOxl7J5FZSvT5rhdHx19ZlsACJ+6WlZWTVRUqIoLd5y0QZMMl0iw0I/WF8h/yAe /UEBXsTcCc+YmbaJLoO1xcWoUBAnd7kLz2Hh1YgxTvRMXuc+HEh3iuTyZZzqKSLC9D6p BJehATp+cC2flDse8c2m7CnpdZwGDJSbtAXKu8q5CHNc9q2WA12zdYUNLajze7csbSu/ pXEUTC3jIjghuwZQseWClv9c6wo0dsCGG8p5Y3D4WiAHZyUgdnncl0q0FWlto2K+r/p/ H1ll+u93sUATHUNEDo/McPg/OwfD9fEsxaXaUaX/9n+DDdS12zeSTecatFu/c//zdt65 mmbQ== X-Gm-Message-State: AOAM530iM7kNCNJnIZrPE1ePZEnNdCPYrfnMJ6XSFo5Qid7R1Keb7BEz B+OjPG0lKuU+Zj/z/olEPsATqiGOJmz1rbv0WHa8Yz1jToJqtq0U9jq1gVUuCXIjlR9/vuTfebY Df7x2lnYcVJk= X-Received: by 2002:a0c:a5a5:: with SMTP id z34mr964539qvz.59.1611255153391; Thu, 21 Jan 2021 10:52:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJx+t6w7Xqx74qVrhjLt4C+TV/igg6sGjjWeLwYgwcTDBDVePcoDrMGpdJssFcXjs87Jbc1oiQ== X-Received: by 2002:a0c:a5a5:: with SMTP id z34mr964502qvz.59.1611255153199; Thu, 21 Jan 2021 10:52:33 -0800 (PST) Received: from xz-x1 ([142.126.83.202]) by smtp.gmail.com with ESMTPSA id i129sm4225591qkd.114.2021.01.21.10.52.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Jan 2021 10:52:32 -0800 (PST) Date: Thu, 21 Jan 2021 13:52:30 -0500 From: Peter Xu To: Axel Rasmussen Cc: 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 Kravetz , 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 2/9] hugetlb/userfaultfd: Forbid huge pmd sharing when uffd enabled Message-ID: <20210121185230.GE260413@xz-x1> References: <20210115190451.3135416-1-axelrasmussen@google.com> <20210115190451.3135416-3-axelrasmussen@google.com> MIME-Version: 1.0 In-Reply-To: <20210115190451.3135416-3-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.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Fri, Jan 15, 2021 at 11:04:44AM -0800, Axel Rasmussen wrote: [...] > @@ -947,4 +948,15 @@ static inline __init void hugetlb_cma_check(void) > } > #endif > > +static inline bool want_pmd_share(struct vm_area_struct *vma) > +{ > +#ifdef CONFIG_ARCH_WANT_HUGE_PMD_SHARE > + if (uffd_disable_huge_pmd_share(vma)) > + return false; > + return true; > +#else > + return false; > +#endif > +} I got syzbot complains about this chunk when compile some other archs outside x86, probably because CONFIG_ARCH_WANT_HUGE_PMD_SHARE can be defined without CONFIG_USERFAULTFD. I don't know why it didn't complain here, so just a fyi that I've pushed some new version to the online repo so that they should have been fixed. For example, for this patch: https://github.com/xzpeter/linux/commit/0fd01db2c9ac3ab8600f3f7df23cf28fddcfee1b static inline bool want_pmd_share(struct vm_area_struct *vma) { #ifdef CONFIG_USERFAULTFD if (uffd_disable_huge_pmd_share(vma)) return false; #endif #ifdef CONFIG_ARCH_WANT_HUGE_PMD_SHARE return true; #else return false; #endif } Thanks, -- Peter Xu