Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754401AbdLDQNl (ORCPT ); Mon, 4 Dec 2017 11:13:41 -0500 Received: from mail-ve1eur01on0136.outbound.protection.outlook.com ([104.47.1.136]:44392 "EHLO EUR01-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754103AbdLDQNc (ORCPT ); Mon, 4 Dec 2017 11:13:32 -0500 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=ktkhai@virtuozzo.com; Subject: [PATCH 4/5] blkcg: Charge aio requests in blkio cgroup hierarchy From: Kirill Tkhai To: axboe@kernel.dk, bcrl@kvack.org, viro@zeniv.linux.org.uk, tj@kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-aio@kvack.org, oleg@redhat.com, ktkhai@virtuozzo.com Date: Mon, 04 Dec 2017 19:13:27 +0300 Message-ID: <151240400729.10164.9814778954180833321.stgit@localhost.localdomain> In-Reply-To: <151240305010.10164.15584502480037205018.stgit@localhost.localdomain> References: <151240305010.10164.15584502480037205018.stgit@localhost.localdomain> User-Agent: StGit/0.18 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [195.214.232.6] X-ClientProxiedBy: HE1PR07CA0015.eurprd07.prod.outlook.com (2603:10a6:7:67::25) To HE1PR0801MB1338.eurprd08.prod.outlook.com (2603:10a6:3:39::28) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 94279df6-cc6b-4d30-6823-08d53b31f4dc X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(4534020)(4602075)(7168020)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603286);SRVR:HE1PR0801MB1338; X-Microsoft-Exchange-Diagnostics: 1;HE1PR0801MB1338;3:+RbtORlY7CS2xJR9zhyy4tnDNi2VlviXkuZNmcjlHJWMyZjtKh6MTHnfCAVK48zPcKyrt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Y3b7ZlM9mcaO8CAsnq4ZK0zAriCxyTBUozRrrVAC6HnDd5rmRw+cTM/s9VjigQG+Uyj965zXjzrfD2FAfX7VQck+DC7v7JtxZjfdq5LxQvztgHTfASl4Nyr4X0ekg9qi2RO+p9tvupJoXEpCyUXd3cenN6ao4/HjsnY/V1+e7LRSxVCz4tymgJxsg=;4:9tv++Q8Q5tHS55k4s2mApsGN0e2yVg6RE6sjXmStla8eWe5GjYIx1pbNWO+BqULOTG0lsxOxK7kMixgDiaeCHrmbgIhlSl/5txc93FpxTJf5nSr0mFd5tIOBNqf6XrM/6IUh6YAKhh0Jh+Wg/+iiPBcceUb19EiMdqbfPBt8slB5YAUhKtU4YK4F2KT0YPOWWhdnZge5mHq73blxTHsMSdHyCmacY+QpoH9CNkHX6nVtGm0rStdvOkqoDuCRWsatZdcxEDLjUFgFo+AwDzWt4huhcvH9T2uJMnvxXmHQYrl+sF9b6q++LJq96inYSGak X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(278428928389397); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040450)(2401047)(5005006)(8121501046)(3231022)(3002001)(10201501046)(93006095)(93001095)(6041248)(20161123562025)(20161123564025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123560025)(6072148)(201708071742011);SRVR:HE1PR0801MB1338;BCL:0;PCL:0;RULEID:(100000803101)(100110400095);SRVR:HE1PR0801MB1338; X-Forefront-PRVS: 051158ECBB X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6009001)(6069001)(366004)(376002)(346002)(189002)(199003)(76176011)(8676002)(55016002)(81166006)(54356011)(8936002)(2906002)(50466002)(105586002)(101416001)(68736007)(2950100002)(86362001)(103116003)(53936002)(83506002)(81156014)(25786009)(61506002)(5660300001)(478600001)(6506006)(47776003)(6116002)(5890100001)(305945005)(66066001)(106356001)(33646002)(3846002)(7736002)(55236003)(16526018)(230700001)(2486003)(52116002)(23676004)(316002)(58126008)(7696005)(97736004)(189998001)(9686003);DIR:OUT;SFP:1102;SCL:1;SRVR:HE1PR0801MB1338;H:localhost.localdomain;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtIRTFQUjA4MDFNQjEzMzg7MjM6WUdCWXl4VzUxOG13OEpaVXFwQkpxZlFU?= =?utf-8?B?N1dvb3BCSXc5TWtDZmZqMEYxSWtDbmdnc043WncvR1FNMS9lZVdDWWlpaDhw?= =?utf-8?B?c0FRTlgzOHczeUpyd2M2Nm5zVEZZSkt0VGMvbUxvZm9vYm1LREJmQnZUbDJZ?= =?utf-8?B?MDFOUGwxSkRuZldBS29PMWYzVUlGeTNNZXpGQVhmWHhzek1sQURRc0kzamV6?= =?utf-8?B?aUF0RkFqaVA1RXVKVk8rMmdKL3lacDAxU0VpRVBEVCtkbVJBTXV3S2ZzcDlI?= =?utf-8?B?dlVrYXUwWGVhb3VOZ2V6ak1NUVVVdVd0N3dudDJHTldsZXFCcG9yYlVOUFNo?= =?utf-8?B?Unh5K2gzbE52bThtcU43VEw3V0NtR1piODJrOTU4ak1xZ1dMblowRTVQTWdR?= =?utf-8?B?dmFTT0x5aXNnK2FkY1FsVVA4ejgyVk81ckwyZ3JSSjhCTURCbjhwd3pEWjAy?= =?utf-8?B?YzVFU2VZcEZqdkNJS054eHkyK0JoN0dZTWhLOWFCRjRoUHNkLzBaa0ZQeTZY?= =?utf-8?B?MTcxWFJiWXc1WktrcVFSemRlMS95eFFFcUFnMEdlOFRSR0VtOTFQTzlyRzNS?= =?utf-8?B?TUExVkdZaGtlNWFSc0ZiTndvMktsTWlMcnpUODlRZVdLYituaUMwWG00aCtT?= =?utf-8?B?d3BKa2theVNmZk84M2pyLy9QWEtJQVBRZDJNbjdLbWd6RWFTdTdERlhHUEFN?= =?utf-8?B?USs0a3o5WnJBUWxRSW5EZy8wbHpXQUc2WDRORHhycW1SbXNrdFdHREV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knLlmT7TfeZmi+LBBcNhHInbl1VF3A5ahyBI2MjQ9Ia0CZU64Shg7NE= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Dec 2017 16:13:28.7189 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 94279df6-cc6b-4d30-6823-08d53b31f4dc X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0801MB1338 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 7966 Lines: 288 This patch adds accounting of number of requests of allocated aio contexts per blkio cgroup, and aggregates child cgroups requests up the hierarhy. This may be used to limit aio requests available for containers. By default, newly allocated blkcg::blkg_aio_max_nr is set to "unlimited" value (see blkcg_css_alloc() in previous patch). This guarantees that applications, which do not know about blkcg::blkg_aio_max_nr, will be able to run like they used to do before, without configuring child cgroup's blkg_aio_max_nr. For protection "task attach" vs "io_context create/destroy" read locked cgroup_threadgroup_rwsem is used. We take it via cgroup_threadgroup_change_*() interfaces, which are used around the places we charge kioctx::max_reqs and link a ctx to mm_struct::ioctx_table. Single allocation are protected aio_nr_lock like it used before. Signed-off-by: Kirill Tkhai --- block/blk-cgroup.c | 44 +++++++++++++++++++++- fs/aio.c | 101 +++++++++++++++++++++++++++++++++++++++++++++++++++ include/linux/aio.h | 11 ++++++ 3 files changed, 153 insertions(+), 3 deletions(-) diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c index 774560469b01..9cc6e9574946 100644 --- a/block/blk-cgroup.c +++ b/block/blk-cgroup.c @@ -1217,8 +1217,8 @@ void blkcg_exit_queue(struct request_queue *q) */ static int blkcg_can_attach(struct cgroup_taskset *tset) { - struct task_struct *task; - struct cgroup_subsys_state *dst_css; + struct cgroup_subsys_state *dst_css, *old_css; + struct task_struct *task, *p; struct io_context *ioc; int ret = 0; @@ -1230,11 +1230,46 @@ static int blkcg_can_attach(struct cgroup_taskset *tset) ret = -EINVAL; task_unlock(task); if (ret) - break; + goto err; + if (!thread_group_leader(task)) + continue; + ret = charge_task_aio_nr(task, css_to_blkcg(dst_css)); + if (ret) + goto err; + old_css = task_css(task, io_cgrp_id); + uncharge_task_aio_nr(task, css_to_blkcg(old_css)); + } +err: + if (ret) { + cgroup_taskset_for_each(p, dst_css, tset) { + if (p == task) + break; + if (!thread_group_leader(p)) + continue; + uncharge_task_aio_nr(p, css_to_blkcg(dst_css)); + old_css = task_css(p, io_cgrp_id); + WARN_ON_ONCE(charge_task_aio_nr(p, css_to_blkcg(old_css))); + } } return ret; } +#ifdef CONFIG_AIO +static void blkcg_cancel_attach(struct cgroup_taskset *tset) +{ + struct cgroup_subsys_state *dst_css, *old_css; + struct task_struct *p; + + cgroup_taskset_for_each(p, dst_css, tset) { + if (!thread_group_leader(p)) + continue; + uncharge_task_aio_nr(p, css_to_blkcg(dst_css)); + old_css = task_css(p, io_cgrp_id); + WARN_ON_ONCE(charge_task_aio_nr(p, css_to_blkcg(old_css))); + } +} +#endif + static void blkcg_bind(struct cgroup_subsys_state *root_css) { int i; @@ -1260,6 +1295,9 @@ struct cgroup_subsys io_cgrp_subsys = { .css_offline = blkcg_css_offline, .css_free = blkcg_css_free, .can_attach = blkcg_can_attach, +#ifdef CONFIG_AIO + .cancel_attach = blkcg_cancel_attach, +#endif .bind = blkcg_bind, .dfl_cftypes = blkcg_files, .legacy_cftypes = blkcg_legacy_files, diff --git a/fs/aio.c b/fs/aio.c index 755f97a42ebe..2e63f5c582c0 100644 --- a/fs/aio.c +++ b/fs/aio.c @@ -40,6 +40,7 @@ #include #include #include +#include #include #include @@ -696,6 +697,97 @@ static int ioctx_add_table(struct kioctx *ctx, struct mm_struct *mm) } } +#ifdef CONFIG_BLK_CGROUP +static bool try_to_charge_blkcg(unsigned long nr, struct blkcg *blkg) +{ + struct blkcg *tmp = blkg; + + while (blkg) { + if (nr + blkg->blkg_aio_nr > blkg->blkg_aio_max_nr || + nr + blkg->blkg_aio_nr < nr) + goto fail; + + blkg->blkg_aio_nr += nr; + blkg = blkcg_parent(blkg); + } + + return true; +fail: + while (tmp != blkg) { + tmp->blkg_aio_nr -= nr; + tmp = blkcg_parent(tmp); + } + return false; +} + + +static void uncharge_blkcg(unsigned long nr, struct blkcg *blkg) +{ + while (blkg) { + blkg->blkg_aio_nr -= nr; + blkg = blkcg_parent(blkg); + } +} + +static bool __try_to_charge_aio_nr(unsigned nr) +{ + struct blkcg *blkg; + + percpu_rwsem_assert_held(&cgroup_threadgroup_rwsem); + blkg = container_of(task_css_check(current, io_cgrp_id, true), + struct blkcg, css); + return try_to_charge_blkcg(nr, blkg); +} + +static void __uncharge_aio_nr(unsigned nr) +{ + struct blkcg *blkg; + + percpu_rwsem_assert_held(&cgroup_threadgroup_rwsem); + blkg = container_of(task_css_check(current, io_cgrp_id, true), + struct blkcg, css); + uncharge_blkcg(nr, blkg); +} + +static unsigned long get_task_max_reqs(struct task_struct *p) +{ + struct kioctx_table *tbl; + unsigned long nr = 0; + struct kioctx *ctx; + int i; + + if (p->flags & PF_KTHREAD) + return 0; + /* rwsem must be write locked */ + tbl = rcu_dereference_protected(p->mm->ioctx_table, + percpu_rwsem_is_held(&cgroup_threadgroup_rwsem)); + if (!tbl) + return 0; + for (i = 0; i < tbl->nr; i++) { + ctx = tbl->table[i]; + if (!ctx) + continue; + nr += ctx->max_reqs; + } + return nr; +} + +int charge_task_aio_nr(struct task_struct *p, struct blkcg *blkg) +{ + unsigned long nr = get_task_max_reqs(p); + + if (!nr || try_to_charge_blkcg(nr, blkg)) + return 0; + return -ENOMEM; +} + +void uncharge_task_aio_nr(struct task_struct *p, struct blkcg *blkg) +{ + unsigned long nr = get_task_max_reqs(p); + if (nr) + uncharge_blkcg(nr, blkg); +} +#else static bool __try_to_charge_aio_nr(unsigned nr) { if (aio_nr + nr > aio_max_nr || @@ -713,6 +805,7 @@ static void __uncharge_aio_nr(unsigned nr) else aio_nr -= nr; } +#endif /* CONFIG_BLK_CGROUP */ static bool try_to_charge_aio_nr(unsigned nr) { @@ -803,6 +896,8 @@ static struct kioctx *ioctx_alloc(unsigned nr_events) if (ctx->req_batch < 1) ctx->req_batch = 1; + cgroup_threadgroup_change_begin(current); + /* limit the number of system wide aios */ err = -EAGAIN; if (!try_to_charge_aio_nr(ctx->max_reqs)) @@ -815,6 +910,8 @@ static struct kioctx *ioctx_alloc(unsigned nr_events) if (err) goto err_cleanup; + cgroup_threadgroup_change_end(current); + /* Release the ring_lock mutex now that all setup is complete. */ mutex_unlock(&ctx->ring_lock); @@ -825,6 +922,7 @@ static struct kioctx *ioctx_alloc(unsigned nr_events) err_cleanup: uncharge_aio_nr(ctx->max_reqs); err_ctx: + cgroup_threadgroup_change_end(current); atomic_set(&ctx->dead, 1); if (ctx->mmap_size) vm_munmap(ctx->mmap_base, ctx->mmap_size); @@ -849,9 +947,11 @@ static int kill_ioctx(struct mm_struct *mm, struct kioctx *ctx, { struct kioctx_table *table; + cgroup_threadgroup_change_begin(current); spin_lock(&mm->ioctx_lock); if (atomic_xchg(&ctx->dead, 1)) { spin_unlock(&mm->ioctx_lock); + cgroup_threadgroup_change_end(current); return -EINVAL; } @@ -871,6 +971,7 @@ static int kill_ioctx(struct mm_struct *mm, struct kioctx *ctx, * could tell). */ uncharge_aio_nr(ctx->max_reqs); + cgroup_threadgroup_change_end(current); if (ctx->mmap_size) vm_munmap(ctx->mmap_base, ctx->mmap_size); diff --git a/include/linux/aio.h b/include/linux/aio.h index de929a8c9c59..bf442e562a8f 100644 --- a/include/linux/aio.h +++ b/include/linux/aio.h @@ -31,9 +31,20 @@ static inline void kiocb_set_cancel_fn(struct kiocb *req, /* for sysctl: */ extern unsigned long aio_nr; extern unsigned long aio_max_nr; + +static inline int charge_task_aio_nr(struct task_struct *p, struct blkcg *g) +{ + return 0; +} +static inline void uncharge_task_aio_nr(struct task_struct *p, struct blkcg *g) +{ +} #else #define aio_nr blkcg_root.blkg_aio_nr #define aio_max_nr blkcg_root.blkg_aio_max_nr + +extern int charge_task_aio_nr(struct task_struct *, struct blkcg *); +extern void uncharge_task_aio_nr(struct task_struct *, struct blkcg *); #endif /* !CONFIG_BLK_CGROUP || !CONFIG_AIO */ #endif /* __LINUX__AIO_H */