Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp5197389pxv; Wed, 28 Jul 2021 05:38:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzyH7kZJmHz9mOoS70uCfH8CbC2O2mLPCD/yqV4AKzENnLDKEZIWztLnK1aBuwa9p8XO1/K X-Received: by 2002:a05:6602:1647:: with SMTP id y7mr23530525iow.30.1627475910632; Wed, 28 Jul 2021 05:38:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627475910; cv=none; d=google.com; s=arc-20160816; b=xbOn9EJ5lUcksKtDwcXctacgFP5gMs56aIwTtOkUSc96SkDJdLPHhJajpa5XyXqhuq Q6er3Xs0ao8f0rYHZ/SaXVTpaQS1xZjg2D3H2Kb8tPHUZzL1BsqU3Af/1r6y6Gs5yE+k Q8zs/HnHHHuDfqCj4l9rmYimn2E3a2KFEFT0/LBsOu21TVmD4YSkrHOs+VYlA9es3prh XtC7VYjDexLBUB2495rRYZ6QsOQZoJ0fd01QT1pEDyAqcPNZGk8Gxqj0XrM17QOMHS1y efu5IiwNnrm0tglWc8wmJN7DNkr4P/FsPjDEaSIFvqgeLtnpzLsFK6e4g3J+Wfa8p97k ygoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=cjdy9NgWTqy6bx2gUVJeHE+WNLvpxTQaYwDjhcGu1m8=; b=KVGJLmQB5H0xyFy70x5exOpacPPzgdYNlyHcWdYnBvnLYa3JpzXTAIgxKkYH6cQSeU HGs9/ncgXuozlB+BBHb2KziRkaLe8l9MfStf+8wZ9oDe44mX2BGwU1NksfF6y1rJ2Nx+ 0V+rQVufZBkIz+qvtjpXebvrVnQTHRCQA/alp6mSMHKezRbPuz1C60uAphYzVfMF1+u0 eVLl0LAMFE4CSLJpzaSQkoLpwOJU0IE+V1iKYmYmy8MEDaGnJP+F2SzbebJhiGDrXV75 DUEs0+hw7YvuHc3ahIU/U4yrupnEQukBrSXaXqxUJkhJIp5aA8oeV9u1Do4nyXaax8yH V0+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=frTN8cvj; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 13si6672071ilt.16.2021.07.28.05.38.19; Wed, 28 Jul 2021 05:38: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=@redhat.com header.s=mimecast20190719 header.b=frTN8cvj; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235244AbhG1MhD (ORCPT + 99 others); Wed, 28 Jul 2021 08:37:03 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:55949 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234869AbhG1Mg5 (ORCPT ); Wed, 28 Jul 2021 08:36:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1627475815; 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=cjdy9NgWTqy6bx2gUVJeHE+WNLvpxTQaYwDjhcGu1m8=; b=frTN8cvjnOsAjnnRFvoJrEaMpphz9jEswp9DrvCFjOQSVLM/s5B9Z/gTwaiMIf5Ijq+Man DO0Kc36lskX3U4hSaZ22pkEd+sH5IJXOP95rKwc9/RU6Dm+JigBLplOUzppbn17reQIW/c NlnEM3b7DaRIJ0PDNUu/JEO4yR+iq4A= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-39-LKSTyXzYP3O3vDe-ovgEFg-1; Wed, 28 Jul 2021 08:36:53 -0400 X-MC-Unique: LKSTyXzYP3O3vDe-ovgEFg-1 Received: by mail-wm1-f69.google.com with SMTP id f10-20020a7bcc0a0000b0290229a389ceb2so1383732wmh.0 for ; Wed, 28 Jul 2021 05:36:53 -0700 (PDT) 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=cjdy9NgWTqy6bx2gUVJeHE+WNLvpxTQaYwDjhcGu1m8=; b=LM8qGPfl9E5orP7vlvVE9ISnl/ZDZArEUyLsU3bdyApLxo1I8xiLSoU1QksFM6ybEf yQ1xJG6n9YkVYLziKWhrz8kFfbBqzsSukGx6PEN79OIg67+TkMa5SXjmUhn+/nzNYdHZ PFE0A2wCABnEHUTsCfnqiYe5s4fH3hV1tvINKIxmNy5MwJYWXUUUY/7CIeezEFSdXL7P ydpNTIjZDLb2Nq9gdS4gAuFMH5T2hOsxsQDtpLy1WXjPVKSOL1X7koWwjdUFdznV/7Wn /5K/9ZfSf4wAPVZbpgpFD+lkAYTaXF//Z6PmqETIR9wk7dGKen6UZahv7Y9Mmx4G5IUl Uqtw== X-Gm-Message-State: AOAM5312g1t8+hr0crwfsU4f5XJusyZspwpnvLEeJeoFxuvtiD9/CUSW bmvmLmpSCmmjcvADerMwPBduAo7BNtBoVGbGJ0WX5RM+3ieOQMXvzNn38o5k8RKR6lkgbTnL9E5 Wa+YIebtMIyoE+NtfXKaIfFzJ X-Received: by 2002:a7b:c144:: with SMTP id z4mr9159243wmi.54.1627475812800; Wed, 28 Jul 2021 05:36:52 -0700 (PDT) X-Received: by 2002:a7b:c144:: with SMTP id z4mr9159215wmi.54.1627475812581; Wed, 28 Jul 2021 05:36:52 -0700 (PDT) Received: from localhost.localdomain ([151.29.58.124]) by smtp.gmail.com with ESMTPSA id g7sm5517380wmq.22.2021.07.28.05.36.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Jul 2021 05:36:51 -0700 (PDT) Date: Wed, 28 Jul 2021 14:36:48 +0200 From: Juri Lelli To: Quentin Perret Cc: Ingo Molnar , Peter Zijlstra , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] sched: Don't report SCHED_FLAG_SUGOV in sched_getattr() Message-ID: References: <20210727101103.2729607-1-qperret@google.com> <20210727101103.2729607-3-qperret@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 28/07/21 10:39, Quentin Perret wrote: > On Wednesday 28 Jul 2021 at 11:12:03 (+0200), Juri Lelli wrote: > > Hi Quentin, > > > > On 27/07/21 11:11, Quentin Perret wrote: > > > SCHED_FLAG_SUGOV is supposed to be a kernel-only flag that userspace > > > cannot interact with. However, sched_getattr() currently reports it > > > in sched_flags if called on a sugov worker even though it is not > > > actually defined in a UAPI header. To avoid this, make sure to > > > clean-up the sched_flags field in sched_getattr() before returning to > > > userspace. > > > > > > Signed-off-by: Quentin Perret > > > --- > > > kernel/sched/core.c | 1 + > > > 1 file changed, 1 insertion(+) > > > > > > diff --git a/kernel/sched/core.c b/kernel/sched/core.c > > > index 2d9ff40f4661..d8f489dcc383 100644 > > > --- a/kernel/sched/core.c > > > +++ b/kernel/sched/core.c > > > @@ -7535,6 +7535,7 @@ SYSCALL_DEFINE4(sched_getattr, pid_t, pid, struct sched_attr __user *, uattr, > > > kattr.sched_priority = p->rt_priority; > > > else > > > kattr.sched_nice = task_nice(p); > > > + kattr.sched_flags &= SCHED_FLAG_ALL; > > > > Maybe we can do this in the previous patch so that it's kept confined to > > deadline bits? > > That works too, it just felt like this could happen again if we start > using non-standard flags outside of deadline for any reason at some > point in the future. But no strong opinion really. Yeah, I also see this point. :) So no prob with me to keep it in core.c as you do here. Best, Juri