Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1276520pxa; Sat, 22 Aug 2020 19:00:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwjIfqMD7BoZw0kehWLvbwEmaTgHrPpB9WYVtWJ81jdzuas9NXleVZB1J8jp3gp0mdLVqsA X-Received: by 2002:a17:906:1a54:: with SMTP id j20mr236028ejf.102.1598148044490; Sat, 22 Aug 2020 19:00:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598148044; cv=none; d=google.com; s=arc-20160816; b=xgw0Ct1MK+uteNIhUhFOozpQHp0IKdibuzW4fuosO7IsgrkSuZSp25QeQQvHIltBr3 p7X9z6Rq7u+UzykOXYpZ2VtQHwt6y3VxVfgmc2lAwbu9YrHaKMnew8NeQWIsJMcbxseG sES9ok7Ho1pj08DCj3ACC+l+/GtDrUSqfArVh8/QEVa84otdVKPaZdyH3xRBHcunHG7S Sve+iLRidozTYEtYUXdZYWKERGHaSJHX6JKVTyJNDafDs8saxkC2TyV8EDBvQT5mo+K5 W7s95Ciu0FbMTjca+Uvpv2kRkhD4bF95niWSUoUrphHO3CYdNMKC2EULpBWac0Dykq0w hmxg== 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:autocrypt:from:references:cc:to:subject; bh=FUpDqn3GSqZeYvxxsArGtttJRoK3eORe52wIumG4FE8=; b=uHrc/UeK8nnbtqALsWwwIJer+2d9L4H4TJGcwm6nIJmYWqgtZPA+DFR02O8YW+LOmk 9lNtlt6vbS6ro4iOmNFWthDZSudtkfQzsNnOoB1uAeo+duFNRfMGPweqD4IdHIyWBcfL xfjI9IHwydQs0c+RYznQhhu2isdHsjVo8VpmVf1Ek1SQzqpy5D0run+Lf4m6oJ6GovKT KOgK46RxPQIku4krZuefcpu+3BFNF8nN8KIHOUsaOpg/0i2MtSfLQAc8vhUBUiTlBqt8 jN8KxFoXcDbGUfcKzHXAoasZyuDO43a4vlRdgUJ8UMdd6Lbjx2zgi0mRSRjTwo7eX1m2 CQWg== ARC-Authentication-Results: i=1; mx.google.com; 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 bi9si5791013edb.366.2020.08.22.19.00.16; Sat, 22 Aug 2020 19:00:44 -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; 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 S1726474AbgHWB6K (ORCPT + 99 others); Sat, 22 Aug 2020 21:58:10 -0400 Received: from mail-pl1-f195.google.com ([209.85.214.195]:40624 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725821AbgHWB6J (ORCPT ); Sat, 22 Aug 2020 21:58:09 -0400 Received: by mail-pl1-f195.google.com with SMTP id b11so2579947pld.7; Sat, 22 Aug 2020 18:58:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=FUpDqn3GSqZeYvxxsArGtttJRoK3eORe52wIumG4FE8=; b=aY0Jy5RHcwfBtdHh392krsm1iOtzGH30PhwwV5WwO3WVNUUdFg2GwunVAxgdqkTNV1 r0/hk7TBQKHwBXU/cq/+DL8hP5a5JujUrVowYDDBtLSqUhhcam01w2XVQQV66KMm81AZ nLNmV2jPwITqPBOEE3R8w4gJheyyT0bBqbAGNlwYL9qN9/SM2pnrwI/NRqwej1Jx7JdY KGg1X1aDJiIBygoxfMEcOUycUkGT/oLFTvoZA6zCtdqBBdvGiM18UmLudv+TzuIBkxLg 0FNgUHXj4oK1ctUs224OA8PaS+fk/NnWWJZrX6tKsM9MJjUbEJS3KXypzggJFvBXYbrk NSRw== X-Gm-Message-State: AOAM533UOvvJeJKP9epS7KKmIu9KE+QX1RqY28Lb120rkERVelY0w3Q4 RRzMFugL+sDjrdG6uxo9ZJQMbE+gy0c= X-Received: by 2002:a17:90a:2e0f:: with SMTP id q15mr4202pjd.49.1598147887514; Sat, 22 Aug 2020 18:58:07 -0700 (PDT) Received: from [192.168.3.217] (c-73-241-217-19.hsd1.ca.comcast.net. [73.241.217.19]) by smtp.gmail.com with ESMTPSA id o192sm7270748pfg.81.2020.08.22.18.58.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 22 Aug 2020 18:58:06 -0700 (PDT) Subject: Re: IOPRIO_CLASS_RT without CAP_SYS_ADMIN? To: Khazhismel Kumykov , axboe@kernel.dk, paolo.valente@linaro.org Cc: linux-block@vger.kernel.org, Linux Kernel Mailing List References: From: Bart Van Assche Autocrypt: addr=bvanassche@acm.org; prefer-encrypt=mutual; keydata= mQENBFSOu4oBCADcRWxVUvkkvRmmwTwIjIJvZOu6wNm+dz5AF4z0FHW2KNZL3oheO3P8UZWr LQOrCfRcK8e/sIs2Y2D3Lg/SL7qqbMehGEYcJptu6mKkywBfoYbtBkVoJ/jQsi2H0vBiiCOy fmxMHIPcYxaJdXxrOG2UO4B60Y/BzE6OrPDT44w4cZA9DH5xialliWU447Bts8TJNa3lZKS1 AvW1ZklbvJfAJJAwzDih35LxU2fcWbmhPa7EO2DCv/LM1B10GBB/oQB5kvlq4aA2PSIWkqz4 3SI5kCPSsygD6wKnbRsvNn2mIACva6VHdm62A7xel5dJRfpQjXj2snd1F/YNoNc66UUTABEB AAG0JEJhcnQgVm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SsED/1nlJ9Oq5fALdNEPgDyPUerqHxcmIub+pF0AzJoYHK5punqpqfGmqPbjxrJLPJfHVKy goMj5DlBMoYqEgpbwdUYkH6QdizJJCur4icy8GUNbisFYABeoJ91pnD4IGei3MTdvINSZI5e Message-ID: <992ed2ed-f644-a5ad-3239-b38ddeafe28b@acm.org> Date: Sat, 22 Aug 2020 18:58:04 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: 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 2020-08-20 17:35, Khazhismel Kumykov wrote: > It'd be nice to allow a process to send RT requests without granting > it the wide capabilities of CAP_SYS_ADMIN, and we already have a > capability which seems to almost fit this priority idea - > CAP_SYS_NICE? Would this fit there? > > Being capable of setting IO priorities on per request or per thread > basis (be it async submission or w/ thread ioprio_set) is useful > especially when the userspace has its own prioritization/scheduling > before hitting the kernel, allowing us to signal to the kernel how to > order certain IOs, and it'd be nice to separate this from ADMIN for > non-root processes, in a way that's less error prone than e.g. having > a trusted launcher ionice the process and then drop priorities for > everything but prio requests. Hi Khazhy, In include/uapi/linux/capability.h I found the following: /* Allow raising priority and setting priority on other (different UID) processes */ /* Allow use of FIFO and round-robin (realtime) scheduling on own processes and setting the scheduling algorithm used by another process. */ /* Allow setting cpu affinity on other processes */ #define CAP_SYS_NICE 23 If it is acceptable that every process that has permission to submit IOPRIO_CLASS_RT I/O also has permission to modify the priority of other processes then extending CAP_SYS_NICE is an option. Another possibility is to extend the block cgroup controller such that the capability to submit IOPRIO_CLASS_RT I/O can be enabled through the cgroup interface. There may be other approaches. I'm not sure what the best approach is. Bart.