Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp463535ybe; Wed, 4 Sep 2019 02:33:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqyihqGiBUjBM28DcTdzJMiAWF7tN5wvYcSxXA5hBamIu3P/CPb5Pg+XpVXrzFw4uC0Fzmi+ X-Received: by 2002:a62:2603:: with SMTP id m3mr46756018pfm.163.1567589634470; Wed, 04 Sep 2019 02:33:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567589634; cv=none; d=google.com; s=arc-20160816; b=ygy154NrkukluD/c4+ESdUNyV9FYl5SgjQS7WMsjixak6wVE5jdM3IKWhEev6vvneZ xhQeHTfljspsZC/awwrMNwSa2EYPnw3CrQEQEcy188W+G5T43zhrzU37dQe2GZSE0/U5 oaeAaUPeElZXPRyqS11gENohtIxC0L9R4c0g6S/R4AdmMdKoEb63rocom+VTn4cD0Al8 IyH9d9VZJ7qPHHlYgkM4cmx40VvKdPmsaemsCGyg9FKDPucd32B9YyPRGe82+m8VypmT Hx+V0sT+ln3QgV6zlejPcPwvvEkNjT2iPGOj9NFbj6k0NpUXQLlIJRh7bwxFEvlzm3Ix qrxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=SXT+rIB9LuuIZbhBpFC2aIn0hGohFuSDgz457jsbzdI=; b=UrwQPjvtKoa2df4OQwQ5Vie1cUyqpUfBZXkjHRP1TuZ75E7pm+5gfa9tpYOW0L3IyO 0yvWSpCsI3y55qypgH+boR4o2xK2naA++3Jo0TWnZwDtMyaM1XUIYXLgH6/0MdBWPYUc bW4DEYpj33pihYBlCUGIqUguzWmFD7M/0ccMS6dXZGyMqJvVWWfF7DfzxrCJM6gBc/5Y v+jNk55fm/p7sdeiYvIeu0TiXVrWFgObJVehkM+Mma73NFItz6KigKCT1Gqp6178LFw4 PWEJoG2WDYHIGKxtWvHh/j4ImTbHY0lpJGGMhZxEvJPQMmnOwgzVgfOUtsKDe/b3gTg1 kcUQ== 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 14si9620065pfj.37.2019.09.04.02.33.39; Wed, 04 Sep 2019 02:33:54 -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 S1729649AbfIDJbe (ORCPT + 99 others); Wed, 4 Sep 2019 05:31:34 -0400 Received: from foss.arm.com ([217.140.110.172]:50388 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727348AbfIDJbd (ORCPT ); Wed, 4 Sep 2019 05:31:33 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 25915344; Wed, 4 Sep 2019 02:31:33 -0700 (PDT) Received: from [192.168.0.8] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 9E07B3F246; Wed, 4 Sep 2019 02:31:31 -0700 (PDT) Subject: Re: [PATCH v3] sched/core: Fix uclamp ABI bug, clean up and robustify sched_read_attr() ABI logic and code To: Ingo Molnar , Thadeu Lima de Souza Cascardo Cc: linux-kernel@vger.kernel.org, Peter Zijlstra , Ingo Molnar , Patrick Bellasi , Thomas Gleixner , Arnaldo Carvalho de Melo , Linus Torvalds , Jiri Olsa References: <20190903171645.28090-1-cascardo@canonical.com> <20190903171645.28090-2-cascardo@canonical.com> <20190904075532.GA26751@gmail.com> <20190904084934.GA117671@gmail.com> <20190904085519.GA127156@gmail.com> From: Dietmar Eggemann Message-ID: Date: Wed, 4 Sep 2019 11:31:19 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190904085519.GA127156@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/09/2019 10:55, Ingo Molnar wrote: > > * Ingo Molnar wrote: > >> + if (!access_ok(uattr, ksize) >> return -EFAULT; > > How about we pretend that I never sent v2? ;-) > > -v3 attached. Build and minimally boot tested. > > Thanks, > > Ingo > This patch fixes the issue (almost). LTP's sched_getattr01 passes again. But IMHO the prio 'chrt -p $$' should be 0 instead of -65536. - tip sched/core (w/ CONFIG_UCLAMP_TASK): root@juno:/opt/ltp/results# chrt -p $$ chrt: failed to get pid 1635's policy: File too large Test Start Time: Wed Sep 4 10:17:34 2019 ----------------------------------------- Testcase Result Exit Value -------- ------ ---------- sched_get_priority_min01 PASS 0 sched_get_priority_min02 PASS 0 sched_getparam01 PASS 0 sched_getparam02 PASS 0 sched_getparam03 PASS 0 sched_rr_get_interval01 PASS 0 sched_rr_get_interval02 PASS 0 sched_rr_get_interval03 PASS 0 sched_setparam01 PASS 0 sched_setparam02 PASS 0 sched_setparam03 PASS 0 sched_setparam04 PASS 0 sched_setparam05 PASS 0 sched_getscheduler01 PASS 0 sched_getscheduler02 PASS 0 sched_setscheduler01 PASS 0 sched_setscheduler02 PASS 0 sched_setscheduler03 PASS 0 sched_yield01 PASS 0 sched_setaffinity01 PASS 0 sched_getaffinity01 PASS 0 sched_setattr01 PASS 0 sched_getattr01 FAIL 1 <--- sched_getattr02 PASS 0 ----------------------------------------------- Total Tests: 24 Total Skipped Tests: 0 Total Failures: 1 Kernel Version: 5.3.0-rc1-00101-g0413d7f33e60 Machine Architecture: aarch64 Hostname: juno - tip sched/core (w/ CONFIG_UCLAMP_TASK) + patch: root@juno:~# chrt -p $$ pid 1633's current scheduling policy: SCHED_OTHER pid 1633's current scheduling priority: -65536 <--- should be 0 Test Start Time: Wed Sep 4 10:22:45 2019 ----------------------------------------- Testcase Result Exit Value -------- ------ ---------- sched_get_priority_min01 PASS 0 sched_get_priority_min02 PASS 0 sched_getparam01 PASS 0 sched_getparam02 PASS 0 sched_getparam03 PASS 0 sched_rr_get_interval01 PASS 0 sched_rr_get_interval02 PASS 0 sched_rr_get_interval03 PASS 0 sched_setparam01 PASS 0 sched_setparam02 PASS 0 sched_setparam03 PASS 0 sched_setparam04 PASS 0 sched_setparam05 PASS 0 sched_getscheduler01 PASS 0 sched_getscheduler02 PASS 0 sched_setscheduler01 PASS 0 sched_setscheduler02 PASS 0 sched_setscheduler03 PASS 0 sched_yield01 PASS 0 sched_setaffinity01 PASS 0 sched_getaffinity01 PASS 0 sched_setattr01 PASS 0 sched_getattr01 PASS 0 <--- sched_getattr02 PASS 0 ----------------------------------------------- Total Tests: 24 Total Skipped Tests: 0 Total Failures: 0 Kernel Version: 5.3.0-rc1-00102-g80a776a6e3b7 Machine Architecture: aarch64 Hostname: juno