Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp4492603ybi; Mon, 15 Jul 2019 09:44:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqzCzitMzAx+5aTwJPIlhP2ICGWS7XkAk4sW93TpCleJwycFqGOfm3+txvnCPigaPWX9hsHL X-Received: by 2002:a65:52ca:: with SMTP id z10mr28632686pgp.424.1563209082031; Mon, 15 Jul 2019 09:44:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563209082; cv=none; d=google.com; s=arc-20160816; b=oWoSz0grpw9YJCJhxf8e4BaIpILzgW4OzeS9CPFmtmLmFzMBOpotRRR5m7pzhL33ZH 8hXGimZJ4glOs9s5fIcWaPfyOS763uSIrO439FFAFvVGE+YeKi6hlsvSHkxmncYhlaFl 5fFvrn5C6hYpARUTChrjAo1UjurFV+8bgveO5HsW9H5yYiHWEGesg08hQGRR383Nx0sJ 5oLYDWEBd1YCjcpqqBhSYM07U38wVv5VmVZ3HGM2Vk+26NsSUiSiB1q9z2Sdf5V6M6EY x6HAeu7eW2y6XB9UVhmD1duMd2vu7+1iPYv3un00hvWAVn74W7955yUdLEB0Vu/b6QMY D8mw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=bkix8Qh4Vy8ITkinj9iYcI2SelB9AT/4uASejMSi0WE=; b=VgYPDAXnzu0Qr7xVrhjhNTbJ6O4GUEISvct1jrzlriHvoGakDZXbmDNiMJb50jZyPW fBegF2lvgtz/O8b+NxQAEfp4W1E4FDGcyPCzSWmeuoG0Ls2s5cGPjd3UMWd0Ybd3KvSn SA+xANUJTXC9WYRYHMdix+ocD+EtsBXfT2cvFJ9NOyuGF2XdYH2vJxySyHShgFZKa0aE 5F8LS3jeUG90G2iZpW5nshpwdZpRFOYdcQRazEwpsnh2GxQlzAZvBs5gk3tws9iZqJpm m35alec2YgYbJuIlJYpRUdbUpw27nM9OH72OESED1tZVvVZsEpWrQIsM93sFoSAX0XAi 68Qw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g18si17564482pgk.477.2019.07.15.09.44.25; Mon, 15 Jul 2019 09:44:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731505AbfGOQmz (ORCPT + 99 others); Mon, 15 Jul 2019 12:42:55 -0400 Received: from mx2.suse.de ([195.135.220.15]:40738 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729941AbfGOQmy (ORCPT ); Mon, 15 Jul 2019 12:42:54 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 9A306AF7A; Mon, 15 Jul 2019 16:42:53 +0000 (UTC) Date: Mon, 15 Jul 2019 18:42:49 +0200 From: Michal =?iso-8859-1?Q?Koutn=FD?= To: Patrick Bellasi Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Ingo Molnar , Peter Zijlstra , Tejun Heo , "Rafael J . Wysocki" , Vincent Guittot , Viresh Kumar , Paul Turner , Quentin Perret , Dietmar Eggemann , Morten Rasmussen , Juri Lelli , Todd Kjos , Joel Fernandes , Steve Muckle , Suren Baghdasaryan , Alessio Balsini Subject: Re: [PATCH v11 4/5] sched/core: uclamp: Use TG's clamps to restrict TASK's clamps Message-ID: <20190715164248.GA21982@blackbody.suse.cz> References: <20190708084357.12944-1-patrick.bellasi@arm.com> <20190708084357.12944-5-patrick.bellasi@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190708084357.12944-5-patrick.bellasi@arm.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 08, 2019 at 09:43:56AM +0100, Patrick Bellasi wrote: > This mimics what already happens for a task's CPU affinity mask when the > task is also in a cpuset, i.e. cgroup attributes are always used to > restrict per-task attributes. If I am not mistaken when set_schedaffinity(2) call is made that results in an empty cpuset, the call fails with EINVAL [1]. If I track the code correctly, the values passed to sched_setattr(2) are checked against the trivial validity (umin <= umax) and later on, they are adjusted to match the effective clamping of the containing task_group. Is that correct? If the user attempted to sched_setattr [a, b], and the effective uclamp was [c, d] such that [a, b] ∩ [c, d] = ∅, the set uclamp will be silently moved out of their intended range. Wouldn't it be better to return with EINVAL too when the intersection is empty (since the user supplied range won't be attained)? Michal [1] http://www.linux-arm.org/git?p=linux-pb.git;a=blob;f=kernel/sched/core.c;h=ddc5fcd4b9cfaa95496b24d8599c03bc140e768e;hb=2c15043a2a2b5d86eb409556cbe1e36d4fd275b5#l1660