Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp6791500pxv; Fri, 30 Jul 2021 02:25:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzLKCQhIMr4VIUdTgxckZUE/IzbyhCkx2i7w1puABysrKVgSWujcfFdobOEMuv6tIhFAEIH X-Received: by 2002:a17:906:8606:: with SMTP id o6mr1661623ejx.247.1627637134333; Fri, 30 Jul 2021 02:25:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627637134; cv=none; d=google.com; s=arc-20160816; b=xYxPz6FEEv/82tH936RMGij1twNjz1UrPPxScYxKb62yBsHp8XIfwbPR2/HwoFUbOV HpLlPYcKATfm/8WosQ9fz+pJ31GNX5DrrlRG12WevQq8H+fJE64PbWwTfBgAuO7qXMbZ tYBp2k5QGlRbacl9+gnYrYTq+S3fJ8uq2t6/bPf5C+malpES8ISgsxzHCdXA+NIBI8+M 4S0EE1OqbG06DzQASjvpCYjTz4QNGa/S4M/phQjFjMTXdZ9XSOMFktxr0dDiqifPuDOp gXm2qWXHdJRZisKcxsfSyPFom8PFLL17Pr9fHLzB/fCBqMzGIHWJhk12vN+6u+e3J862 UuSg== 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=hztfF3mk+w2hTp5cK9vPRcBqwpAjiT5aSw+6qCP4+BI=; b=enUYbmvgLgKOMJ2jadLCetVlcuXHpBIJ7wakLDCvIIu78eMx7NedVQ8ectpUyDuVjU ozS96tKTLQ2NgrHMNvE/UFMPxSJF3vbXQ+Z8gscAWuVzhnUe8SUygas97413EdfLhmX9 WQp9DX6tQtfp3kmtRtLcGfv+tpjmYVrvo0YqHlPpz6nepg/mHILkvXLnhkb/rtzds38j acJkL8AoW1vcwfhEvhNCP24Jwq3xv0vJgVqLW2d9P58H26iOiaOz9u8ba4bnNjYnYerw XO/47GA75eJcac8Wb73kea43gUl+3xYXddR7IWFm4aR2TsVk85jQA51CnXDiLqDaXtjj xORg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=cl1XIBjY; 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 z62si1414090ede.60.2021.07.30.02.25.11; Fri, 30 Jul 2021 02:25:34 -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=cl1XIBjY; 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 S238175AbhG3JW3 (ORCPT + 99 others); Fri, 30 Jul 2021 05:22:29 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:44340 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230336AbhG3JW3 (ORCPT ); Fri, 30 Jul 2021 05:22:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1627636944; 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=hztfF3mk+w2hTp5cK9vPRcBqwpAjiT5aSw+6qCP4+BI=; b=cl1XIBjYiKTZ0JhyWAKUKgSUKWNENyWvr6DXUeB7zOKkX+5ewBnBiUdykCSZUSnMqQPQcs 8xigh23+Uk7gRZo11GJOuv1ZmUeCaRlamxWsnII6ZQ/3UoI3dsQ22uynDC0sWj55qtvfDg /dQaBRPVM+d8FJ4P6acFZLQpjx6C5iU= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-214-yvw0Kr7GNWi0W1lSyEZwXg-1; Fri, 30 Jul 2021 05:22:23 -0400 X-MC-Unique: yvw0Kr7GNWi0W1lSyEZwXg-1 Received: by mail-wr1-f72.google.com with SMTP id d14-20020adfe2ce0000b029013a357d7bdcso3028069wrj.18 for ; Fri, 30 Jul 2021 02:22:22 -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=hztfF3mk+w2hTp5cK9vPRcBqwpAjiT5aSw+6qCP4+BI=; b=BA8JyCDiiVbFqfM9759yBJ4blB4tc7Hs7NeUlL3dJZJsk/ODsRO8e6/Vl0lTLDXpK6 cfXDAdjXm9jEY/9bN3Ed8k7ScuMCy54VZ5ftsa3TM67tnBnUxdGMVrj6vmv3S6CeZ5k0 CI3qxGabVBv6epAJujnoRiippVxaKOOQrHoFjQO9/BEQB872EYK644NNVUJZoeQiDk2G OGyhE4zz89a1fo/tNDFtjOWBFfNWbPxmAX3u+viZBq4f2swD7gSw6rwL9iShkhPxBZtA xY8jw0TN1GmugQkQnA51e1Ru4wogpfSCtizNbLUfiT38lHtcRvFtSzzatgzlbu5v3f7T f5Vg== X-Gm-Message-State: AOAM531nt+OpFrRvY6bco50W6Bf+eynqUsg/w1PJ9ClRGCrL1iAamPpG /MfAqn7Y5z+X/+XukAluQbdKrxqa4b/uxoyIK5L/DOInQI1RusC5r0ANtgaVIo/5Ayg5p1prOdQ WAaUAZxP1eoMmlSroSRHMgeK/ X-Received: by 2002:a1c:e90f:: with SMTP id q15mr1918316wmc.175.1627636941776; Fri, 30 Jul 2021 02:22:21 -0700 (PDT) X-Received: by 2002:a1c:e90f:: with SMTP id q15mr1918301wmc.175.1627636941567; Fri, 30 Jul 2021 02:22:21 -0700 (PDT) Received: from localhost.localdomain ([151.29.58.124]) by smtp.gmail.com with ESMTPSA id p8sm1014945wrn.79.2021.07.30.02.22.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Jul 2021 02:22:20 -0700 (PDT) Date: Fri, 30 Jul 2021 11:22:18 +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, kernel-team@android.com Subject: Re: [PATCH v2] sched/deadline: Fix sched_getattr() for DL tasks Message-ID: References: <20210729175214.294142-1-qperret@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210729175214.294142-1-qperret@google.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 29/07/21 18:52, Quentin Perret wrote: > In its current state, sched_getattr() can report incorrect sched_flags > if called on a deadline task. > > Firstly, if the reset_on_fork flag is set on a deadline task using > sched_setattr() with SCHED_FLAG_RESET_ON_FORK | SCHED_FLAG_KEEP_PARAMS, > p->sched_reset_on_fork will be set but __setscheduler() will bail out > early without updating the dl_se->flags. Consequently, if sched_getattr > is then called on the same task, __getparam_dl() will override > kattr.sched_flags with the now out-of-date copy in dl_se->flags and > report a stale reset_on_fork value to userspace. > > And secondly, sched_getattr() currently reports SCHED_FLAG_SUGOV as set > if called on a schedutil worker, despite this flag being a kernel-only > value that is not exposed in UAPI headers. > > To fix both of these problems, make sure to only copy the flags that are > relevant to sched_deadline to dl_se->flags, and filter them out when > reporting them back to userspace. > > Signed-off-by: Quentin Perret Looks good to me. Acked-by: Juri Lelli Thanks! Juri