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=-24.8 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,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1,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 9D0AFC433B4 for ; Wed, 12 May 2021 18:56:08 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id F2B11611BD for ; Wed, 12 May 2021 18:56:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F2B11611BD 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 1FF446B006C; Wed, 12 May 2021 14:56:07 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1AEE36B006E; Wed, 12 May 2021 14:56:07 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 027D36B0070; Wed, 12 May 2021 14:56:06 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0044.hostedemail.com [216.40.44.44]) by kanga.kvack.org (Postfix) with ESMTP id C0AE16B006C for ; Wed, 12 May 2021 14:56:06 -0400 (EDT) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 54731181AEF31 for ; Wed, 12 May 2021 18:56:06 +0000 (UTC) X-FDA: 78133483932.10.F160138 Received: from mail-qv1-f45.google.com (mail-qv1-f45.google.com [209.85.219.45]) by imf13.hostedemail.com (Postfix) with ESMTP id DE1A9E000128 for ; Wed, 12 May 2021 18:55:49 +0000 (UTC) Received: by mail-qv1-f45.google.com with SMTP id q5so12613593qvv.6 for ; Wed, 12 May 2021 11:56:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=qB5a5NHXXyxPwz9K78GDVHK54gqX2Ll2OYQKQbqeBlM=; b=hoDagBMwZMAQcRmccAgeDCgrfjMPJ0k71IArx7uvzmc0NFm4KeDQVmZRazuHKV4Mk0 S3lpfQA2+a/i2Nx6O4kbIbTDDpnaYRbjiJ2eZrZFj5wfPrnhcWLWw+aJhaGlpR4WH9Zv s5CCwJMoOEhAPeN/VUmoZbCUnz4rxbRxfZqnYFKRrxZFOuDgca/GI1/2wd/xprnpfGtf ZXW/N2tK9YJoPNzCniZzux3xF2yr05OVSRdvdZFiGopHY2PyileJFr4H81OFf3MhyOVS qj7mkWa3q+xyi8dxrXgBGwityI3FQXkywGTQ1EOe0MzjZDvPNg2jpjG+AKUPu6MwD2AI A2bQ== 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:in-reply-to:message-id :references:user-agent:mime-version; bh=qB5a5NHXXyxPwz9K78GDVHK54gqX2Ll2OYQKQbqeBlM=; b=HgAkOJ7uPZeKV62q7RTOOp8DJx5+AIiyvEwxaprcvP8FvfNcxBye87DnrFOQQteckc Cv4+VVnGW/TE4oX73AOu5uCma4CMPE29fkxna6oyD2t5oJO43VK2gsiUuIWyWsgLVul0 t8rY5KGn2vPgDDfewejyL2jfjOlqNSM0izylOoMW4Yq3z2FbFB3KpiHU2tHRrC2lCfZh 1utki6ENX8RUF744+YnKKjKyBtJaUKQXA/xHXYce0DGSg+uYbFdq2ptLW2ejaK2DCzoe as0jF+9yYM994ACUu2iC9ogJx+G06x2AMe3uMXQadKmcnIPgSFAe9CZB3QOXAtnA+JuG hm0w== X-Gm-Message-State: AOAM531i+Ob3U2gXSv6IqYZNq43i9NhfYoehdV7KYFm4OB32b2k/pXxw xseh5gA1EohO8m7Xto5AemU92g== X-Google-Smtp-Source: ABdhPJxw0ds2jBRXeOXhQbYLno0WBJuuFf4yWOMTkx17u79uTKT8p5bc1wAW7QkaAP7IbN+fSBDP1w== X-Received: by 2002:a0c:9e0f:: with SMTP id p15mr36291316qve.27.1620845764907; Wed, 12 May 2021 11:56:04 -0700 (PDT) Received: from eggly.attlocal.net (172-10-233-147.lightspeed.sntcca.sbcglobal.net. [172.10.233.147]) by smtp.gmail.com with ESMTPSA id y23sm665706qtm.54.2021.05.12.11.56.03 (version=TLS1 cipher=ECDHE-ECDSA-AES128-SHA bits=128/128); Wed, 12 May 2021 11:56:04 -0700 (PDT) Date: Wed, 12 May 2021 11:55:52 -0700 (PDT) From: Hugh Dickins X-X-Sender: hugh@eggly.anvils To: Axel Rasmussen cc: kernel test robot , kbuild-all@lists.01.org, clang-built-linux@googlegroups.com, Linux Memory Management List , Peter Xu , Andrew Morton , Hugh Dickins , Mike Kravetz Subject: Re: [linux-next:master 2078/2633] include/linux/hugetlb.h:340:30: error: variable has incomplete type 'enum mcopy_atomic_mode' In-Reply-To: Message-ID: References: <202105122224.mJzg3ncL-lkp@intel.com> User-Agent: Alpine 2.11 (LSU 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Rspamd-Queue-Id: DE1A9E000128 Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=google.com header.s=20161025 header.b=hoDagBMw; spf=pass (imf13.hostedemail.com: domain of hughd@google.com designates 209.85.219.45 as permitted sender) smtp.mailfrom=hughd@google.com; dmarc=pass (policy=reject) header.from=google.com X-Rspamd-Server: rspam04 X-Stat-Signature: hh7ntwik6wxhgzrcugzfw8qsigrqsu5q Received-SPF: none (google.com>: No applicable sender policy available) receiver=imf13; identity=mailfrom; envelope-from=""; helo=mail-qv1-f45.google.com; client-ip=209.85.219.45 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1620845749-55782 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 Wed, 12 May 2021, Axel Rasmussen wrote: > Andrew, the straightforward fix is just to drop this commit, which is > currently in the mm tree (not in v5.13-rc1): Yes, that's easiest. > > 09ff184a3eb1c9 userfaultfd/hugetlbfs: avoid including userfaultfd_k.h > in hugetlb.h > > (Happy to send a revert patch, but I suspect it's easier for you to > drop than to revert + squash later?) > > Adding Hugh as well, since he suggested this cleanup and might prefer > doing something else instead. Yes, sorry for dropping you in it. > > On Wed, May 12, 2021 at 7:45 AM kernel test robot wrote: > > > > tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master > > head: ec85c95b0c90a17413901b018e8ade7b9eae7cad > > commit: 09ff184a3eb1c9cb42f64325ca4a51e36206f4f5 [2078/2633] userfaultfd/hugetlbfs: avoid including userfaultfd_k.h in hugetlb.h > > config: s390-randconfig-r023-20210512 (attached as .config) > > compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project a0fed635fe1701470062495a6ffee1c608f3f1bc) > > reproduce (this is a W=1 build): > > wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross > > chmod +x ~/bin/make.cross > > # install s390 cross compiling tool for clang build I was puzzled, thinking it was something special to s390 or to clang; until noticing that it says s390-randconfig above. > > # apt-get install binutils-s390x-linux-gnu > > # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=09ff184a3eb1c9cb42f64325ca4a51e36206f4f5 > > git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git > > git fetch --no-tags linux-next master > > git checkout 09ff184a3eb1c9cb42f64325ca4a51e36206f4f5 > > # save the attached .config to linux build tree > > COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=s390 > > > > If you fix the issue, kindly add following tag as appropriate > > Reported-by: kernel test robot > > > > All errors (new ones prefixed by >>): > > > > In file included from arch/s390/mm/fault.c:33: > > >> include/linux/hugetlb.h:340:30: error: variable has incomplete type 'enum mcopy_atomic_mode' > > enum mcopy_atomic_mode mode, > > ^ > > include/linux/hugetlb.h:18:6: note: forward declaration of 'enum mcopy_atomic_mode' > > enum mcopy_atomic_mode; > > ^ And line 340 is not the first, usual use of mcopy_atomic_mode in hugetlb.h, but its use in the CONFIG_USERFAULTFD=y CONFIG_HUGETLB_PAGE=n static inline stub. Right, the compiler would probably want to compile that before optimizing it away; and want to know more about the enum to do so. My actual preference would be to keep the "enum mcopy_atomic_mode;" patch, and fix it with the patch below: since the only call to hugetlb_mcopy_atomic_pte() is under #ifdef CONFIG_HUGETLB_PAGE anyway. But since I have not even tried building with this patch on x86_64 gcc, in any configuration at all, I expect you all to be rather wary of my suggestions by now, and prefer to just drop the troublesome patch. But in case anyone is tempted, now or later, --- mmotm/include/linux/hugetlb.h 2021-05-11 08:33:39.987553392 -0700 +++ linux/include/linux/hugetlb.h 2021-05-12 11:20:52.385063935 -0700 @@ -331,20 +331,6 @@ static inline void hugetlb_free_pgd_rang BUG(); } -#ifdef CONFIG_USERFAULTFD -static inline int hugetlb_mcopy_atomic_pte(struct mm_struct *dst_mm, - pte_t *dst_pte, - struct vm_area_struct *dst_vma, - unsigned long dst_addr, - unsigned long src_addr, - enum mcopy_atomic_mode mode, - struct page **pagep) -{ - BUG(); - return 0; -} -#endif /* CONFIG_USERFAULTFD */ - static inline pte_t *huge_pte_offset(struct mm_struct *mm, unsigned long addr, unsigned long sz) {