Received: by 2002:a25:1104:0:0:0:0:0 with SMTP id 4csp268371ybr; Fri, 22 May 2020 06:16:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyNxxXTQXQyaNG5vWJcFeeXWmSojr9VdttyKtnNSfF4mu+66j9QHlmLfKItLRRbUn+l+UBX X-Received: by 2002:a17:906:2b4f:: with SMTP id b15mr7736458ejg.64.1590153403637; Fri, 22 May 2020 06:16:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590153403; cv=none; d=google.com; s=arc-20160816; b=So//cllQGIO6yb4NYkeurxKlWWIeTQHKtkf6AGlhxU/HrEzKjTSgubzDKdLz/i5PHm wnRZzawNTZibF8NI9HgwzH2Zq8eUNrBwct2x1kPmVrArYWLQxR93DQF35RSj19wVNgTe zYpBpANW2r5Y1HDbNnLuiBOeysdBNoJYpFbORAovDITaaCb6wNLUC7ozx7IYspeIHCXl 9Rn1npH2zT/q/wKH8mTJ0b57f0nia8ywsxWPzo/TZ5sHQCu1NssnngZPU+nioCVYBpUw ZVQPmyK+lfUNAZMDaQHmLMY3cnreY5lwsdodszXmRE+uiWQl/VEHED2DZdj+qHlxZW5c UFUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=L1KcGgdIol33X9wWwp43Qhwyao5LirsCVGrmRhN+444=; b=fKtCn14AKpF9Ofq4MYnbOYCRrvL6RgXA4YkWkZDK7fscxDqcqBuzvqx4dO6xMTamT6 pdtldPZo3UPca0SZmzWWzE8GgrNYsHqtj3f7DZaizy1Qf4u/339VT3o5dX6tqDgfqFDm er61ubC6iM+wLoMqR9QJ6pH34hp9Ds3WXhGfQnQe4yGCDitAIqiLfzvYUmLIjjq7rs2f 2EFTEfT6vbfpNLE6AZc2DCfhNBeSr67xLJV2ffUUJFhmNbVPnxLN+RFxahZYwe3IUoX+ WRH/BuvWTzP2gvydLKOotaIjygP6fIqmFgXwmPG0pF8LVREB6rJCcdhucT6qqrcq6+vn vQgA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f21si4786103eja.565.2020.05.22.06.15.49; Fri, 22 May 2020 06:16:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729891AbgEVNOB (ORCPT + 99 others); Fri, 22 May 2020 09:14:01 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:35245 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729334AbgEVNOB (ORCPT ); Fri, 22 May 2020 09:14:01 -0400 Received: from ip5f5af183.dynamic.kabel-deutschland.de ([95.90.241.131] helo=wittgenstein) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1jc7Uq-00072T-CU; Fri, 22 May 2020 13:13:56 +0000 Date: Fri, 22 May 2020 15:13:55 +0200 From: Christian Brauner To: Joel Fernandes Cc: LKML , Matthew Blecker , Jesse Barnes , Mike Frysinger , Christian Brauner , Vineeth Remanan Pillai , vineethrp@gmail.com, Peter Zijlstra , stable , Greg Kroah-Hartman Subject: Re: [PATCH RFC] sched/headers: Fix sched_setattr userspace compilation issues Message-ID: <20200522131355.f4bdc2f4h2zyqbku@wittgenstein> References: <20200521155346.168413-1-joel@joelfernandes.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 21, 2020 at 11:55:21AM -0400, Joel Fernandes wrote: > On Thu, May 21, 2020 at 11:53 AM Joel Fernandes (Google) > wrote: > > > > On a modern Linux distro, compiling the following program fails: > > #include > > #include > > #include > > #include > > > > void main() { > > struct sched_attr sa; > > > > return; > > } > > > > with: > > /usr/include/linux/sched/types.h:8:8: \ > > error: redefinition of ‘struct sched_param’ > > 8 | struct sched_param { > > | ^~~~~~~~~~~ > > In file included from /usr/include/x86_64-linux-gnu/bits/sched.h:74, > > from /usr/include/sched.h:43, > > from /usr/include/pthread.h:23, > > from /tmp/s.c:4: > > /usr/include/x86_64-linux-gnu/bits/types/struct_sched_param.h:23:8: > > note: originally defined here > > 23 | struct sched_param > > | ^~~~~~~~~~~ > > > > This is also causing a problem on using sched_attr Chrome. The issue is > > sched_param is already provided by glibc. > > > > Guard the kernel's UAPI definition of sched_param with __KERNEL__ so > > that userspace can compile. > > > > Signed-off-by: Joel Fernandes (Google) > > If it is more preferable, another option is to move sched_param to > include/linux/sched/types.h Might it be worth Ccing libc-alpha here? Seems like one of those classic header conflicts. Christian