Received: by 2002:a25:1104:0:0:0:0:0 with SMTP id 4csp285868ybr; Fri, 22 May 2020 06:40:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzjG0gNOyBCcWhe4S2A+/7S9+dcFzJ6zS6T0YeshmqZpftlrv+0AhUsIGCzCjm96LGrg5ED X-Received: by 2002:a17:906:6bc5:: with SMTP id t5mr8072901ejs.459.1590154830229; Fri, 22 May 2020 06:40:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590154830; cv=none; d=google.com; s=arc-20160816; b=Ygr1QweLMk2Jzikb+3IeGkqLrhuCQFcSDe9bgY8VZ3D0bUjy/HFkb/oDS78Zf1uHJ9 HdEmC4Y+NKEivRCH9dkw3l6yYb+69tlQL3a6lyp2qfDpcO5rIytJNlwH5agexl+SuwIk YGsR3HXcs50YElxfpXnwmL2tJ5QbcgRcBnEBhRvbwNTQSRr6WGrL44SQpT6uOlSAc2tX dCp+qKD6L4y+ngJfA3ur7QwJ2hL0qvQXl16vvpBP3b25WaXOIuY831hy4axAwSaM4QKL l36Rdz8laQZXeuwV2jLQ+Ga/vpplCD5udkQD5BWyGYEZCx71xbSRq8C9+WDEg1ZrGk7X e5JA== 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:dkim-signature; bh=YBx0QmgBlhkPaubO0vtt6QDHFJk7HKYLiMKXWU9gGLs=; b=yu3NY68zwIFzB8fzfHhfXEtVtuiv6FX50R8Om8jkHmUkZu9y188E26tHuDkp5O76cp wRa24xZxTUSjLn6m99QIR7hGuQVMTxl7jpBWLYSYcoXD+CBKVKUS4VGEyUNFfipbsOKf AyI8Wo2wnGQ15WYlVJmSDSbqF4rVWYHw06u6jB8HeQ3NkblDrn+M2Y1zmvTIs7w+GuHe VoqVIecnDR6cHSN+MUNMwqbwPtdYyX9RTRWCZ10fVvxQ96SSJOHdwE0S/L5u0Q+oQyVv E37pO8DoOMh1dPcu6mioAYmJozedAIHz9aIPsJzc2O6eHUKz/SbU7pyCGy8NUMze2GiH DebA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=PrjvHlWo; 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 a14si4324995edv.358.2020.05.22.06.40.05; Fri, 22 May 2020 06:40:30 -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; dkim=pass header.i=@joelfernandes.org header.s=google header.b=PrjvHlWo; 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 S1729979AbgEVNiT (ORCPT + 99 others); Fri, 22 May 2020 09:38:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45764 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729922AbgEVNiS (ORCPT ); Fri, 22 May 2020 09:38:18 -0400 Received: from mail-qk1-x742.google.com (mail-qk1-x742.google.com [IPv6:2607:f8b0:4864:20::742]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 438E8C05BD43 for ; Fri, 22 May 2020 06:38:18 -0700 (PDT) Received: by mail-qk1-x742.google.com with SMTP id f13so10716449qkh.2 for ; Fri, 22 May 2020 06:38:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=YBx0QmgBlhkPaubO0vtt6QDHFJk7HKYLiMKXWU9gGLs=; b=PrjvHlWoGx0tOv0xWyqyUec5LfWVpFdXT95xXV2W7uO6uczntwzYivL0XfeTSyxKOJ rbS28lT8ArAQ3vl6VS9se8TLJFiS/+VqDagHUXwvaY6okiRqnr4r7mqZYeA6/3rhZrMG f9jVGK3EDVQgrJYwc+PXdgKKGw7FOdxNKC/pg= 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:content-transfer-encoding :in-reply-to; bh=YBx0QmgBlhkPaubO0vtt6QDHFJk7HKYLiMKXWU9gGLs=; b=e/k26ejN9JfrttHfmdgI8a8G9HN2dLGLyl4Tar6s3q1fOuQGlCrxbUY595D10/jvd+ Z47Ir9f2KwdHSsmbMCpJF8POu1MnmscXoJm/MnskWDKzmwzXtZ54ljuVGXGNlu9chBpB 6+/U0F+qW4ybNPox9soYMi56AcjsWUjtLX13Zni4HrAcJJyc2rUFRgpRs2mK7WMktKIR 7Db5P2NNZMAtlgxv9ygkT/k3zXi95bknNkmRFeVJg0Mwbdlx+NizoQGjax9nFX0CZysc 0szb14H/GUb9Q57Ro2kVacYLHL2TXNRE/Lqz4lEROzO/z7jMkqfQvS6ERtzPTryfwPJp 2bjg== X-Gm-Message-State: AOAM530MgyWiJobZmmaYWGShCh6NN2xAjhVvqSxyI0sFromchhMJOq03 uLbFuBzJTzY2JzvlmMRbbjaP5g== X-Received: by 2002:a05:620a:6b7:: with SMTP id i23mr14461310qkh.156.1590154697354; Fri, 22 May 2020 06:38:17 -0700 (PDT) Received: from localhost ([2620:15c:6:12:9c46:e0da:efbf:69cc]) by smtp.gmail.com with ESMTPSA id m33sm7675398qte.17.2020.05.22.06.38.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 May 2020 06:38:16 -0700 (PDT) Date: Fri, 22 May 2020 09:38:16 -0400 From: Joel Fernandes To: Christian Brauner 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: <20200522133816.GB210175@google.com> References: <20200521155346.168413-1-joel@joelfernandes.org> <20200522131355.f4bdc2f4h2zyqbku@wittgenstein> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200522131355.f4bdc2f4h2zyqbku@wittgenstein> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 22, 2020 at 03:13:55PM +0200, Christian Brauner wrote: > 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. sched_param is defined by POSIX from my reading of the manpage. Is the kernel supposed to define it in the UAPI at all? I guarded it with __KERNEL__ as you can see. Resent with libc-alpha CC'd per your suggestion. thanks, - Joel