Received: by 2002:a25:1104:0:0:0:0:0 with SMTP id 4csp522837ybr; Fri, 22 May 2020 12:13:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxHPTjXmn2idTYnQlUXIAnKZO8FiAvaA+f7lJV+wwo5cgthXyWlPBx9JXfpqk56HoEpPXMh X-Received: by 2002:a17:906:bce6:: with SMTP id op6mr9294534ejb.337.1590174788986; Fri, 22 May 2020 12:13:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590174788; cv=none; d=google.com; s=arc-20160816; b=X6AteMZvDKVSHzo+/ZnJyAZ4Mjf6C1nR6RBQbHOsEZTgbknhfN8X54Ri77Yl9ujPQg ozApCAMG9bCwWu/e5YmXIklmuFUqDlocNQ+85nP3mp1P3BKLgfBikmO9XRsC06SF/dVh 4ekN7HoFy+dRw9WTm8aeaQIVEBIZy+25KrjwIYfQ4Er1GKI4ZGP210iuoq3a9DsSU8TM WctYd/9jV4kQtU/qGV7ZLTRqIaIbIsBY71aQwmuOc+DzMWM95cauRvizw9Y08Er6kjZI uuhuUKW0lkz8sr1Ku33JHtoA8+A4hKzL2CrCoTfAoOh16eSWywAUY5PLYhPgF4kta1ys EU8A== 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=l5Gcr5m4S/6pQuLY8XpkHljkd4WMuN97DO2m6VE7kCE=; b=YJCeAj9qv0B+Ag5pvmSVpkapCnEqC9fMVjWKkjjaxgTQxJk7Z0ISVjrtRgYvlwZwHh Q4uUXQZSOYfsSflP/PK7mARnrLZ7Ie76FkIv8Bc6xPMUdyIs+mY9GAkDNsY5JdT8lT74 +jLLmZQxikeh+egSBDubbjABMI5fnNql6u9E/kG0z4ro8syxVSXXaMqpIx9Raz5JENUM 0XFEgynuwpfFz+Dtdv12hciupisyFZ0NTdDiZUzTorLIcgboT6g9/zYXRRk/qk0TZvA0 ifYnyux7SwAwK0bZS/S+zs3dRHMcznwqVsdo4jhu2w5gOLP/HkhDl0gFdOZhg4uocVlH Rp5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=cRntDdoY; 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 l23si5601616edj.333.2020.05.22.12.12.45; Fri, 22 May 2020 12:13:08 -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=cRntDdoY; 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 S1731004AbgEVTIl (ORCPT + 99 others); Fri, 22 May 2020 15:08:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40956 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730922AbgEVTIk (ORCPT ); Fri, 22 May 2020 15:08:40 -0400 Received: from mail-qt1-x843.google.com (mail-qt1-x843.google.com [IPv6:2607:f8b0:4864:20::843]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A63B7C05BD43 for ; Fri, 22 May 2020 12:08:39 -0700 (PDT) Received: by mail-qt1-x843.google.com with SMTP id l1so9143989qtp.6 for ; Fri, 22 May 2020 12:08:39 -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=l5Gcr5m4S/6pQuLY8XpkHljkd4WMuN97DO2m6VE7kCE=; b=cRntDdoYIMzWKFILaRkTlszjX/lMqXJHF+YaYPhXxUqbOBzsGIvYxVds1TOclAb3Eg K9avNoRQEWW7GyBys2tg6s/5hBQI01Bc0PSfg5Wyf/tgsC9Mep9Oe97SD8hWq6sc1cAg yHpaB0AOjDg0E0U/klbbRZnfO6eDi0WriOMJo= 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=l5Gcr5m4S/6pQuLY8XpkHljkd4WMuN97DO2m6VE7kCE=; b=SAinG/drAbgb4eWjvMOpE75Ia8r733zYgoOkxR8eYvIKkidfXbsusTpIGNzZiDZ0y+ 7UWb7dh84Z26IsEx2Bbg5T4R/E8F0xujBf6WRChp4R8frLJZQpdBdQR0BOPQzf2ELqfa z4k5ViL/5zw2oM+iAqatTysaZ905kew16Ib/LpoHnafeLg988NTmK8S4vJelXQItny93 ZV6/VFyPuL3CiSeqlrlhE7cejiGw1ITkDKD4agRdaP1rdl7ifhv0FnO2UXBelM97tjcp rJMqmp8wj9h77Is+h7yPk5chEF0b4SYopJbRXkIMFYMR2BDpe+G3UDwv+r1MyUiR3F9t 0koQ== X-Gm-Message-State: AOAM533CC5xKpffh/5Wsw+IbbiVjukhmd3yNOT0C+832NK6coHu4pL6H vU36HwrRzwLyjy4USx5nkIhhZg== X-Received: by 2002:ac8:6bd5:: with SMTP id b21mr12891370qtt.90.1590174518838; Fri, 22 May 2020 12:08:38 -0700 (PDT) Received: from localhost ([2620:15c:6:12:9c46:e0da:efbf:69cc]) by smtp.gmail.com with ESMTPSA id 88sm8797502qth.9.2020.05.22.12.08.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 May 2020 12:08:38 -0700 (PDT) Date: Fri, 22 May 2020 15:08:37 -0400 From: Joel Fernandes To: Peter Zijlstra Cc: LKML , Matthew Blecker , Jesse Barnes , Mike Frysinger , Christian Brauner , Vineeth Remanan Pillai , vineethrp@gmail.com, stable , Greg Kroah-Hartman Subject: Re: [PATCH RFC] sched/headers: Fix sched_setattr userspace compilation issues Message-ID: <20200522190837.GB213825@google.com> References: <20200521155346.168413-1-joel@joelfernandes.org> <20200522140226.GT317569@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200522140226.GT317569@hirez.programming.kicks-ass.net> 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 04:02:26PM +0200, Peter Zijlstra 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 > > Yeah, not sure. Ingo, you got a preference? > > Also, this very much misses a Fixes tag. Ok, will add Fixe: tag as follows: Fixes: e2d1e2aec572a ("sched/headers: Move various ABI definitions to ") thanks, - Joel