Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752105AbdLDXFl (ORCPT ); Mon, 4 Dec 2017 18:05:41 -0500 Received: from mail-he1eur01on0128.outbound.protection.outlook.com ([104.47.0.128]:17544 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751846AbdLDXFh (ORCPT ); Mon, 4 Dec 2017 18:05:37 -0500 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=ktkhai@virtuozzo.com; Subject: Re: [PATCH 0/5] blkcg: Limit maximum number of aio requests available for cgroup To: Tejun Heo Cc: axboe@kernel.dk, bcrl@kvack.org, viro@zeniv.linux.org.uk, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-aio@kvack.org, oleg@redhat.com References: <151240305010.10164.15584502480037205018.stgit@localhost.localdomain> <20171204200756.GC2421075@devbig577.frc2.facebook.com> <17b22d53-ad3d-1ba8-854f-fc2a43d86c44@virtuozzo.com> <20171204215234.GN2421075@devbig577.frc2.facebook.com> <6eaa11a6-a087-42ab-df65-9142b59bf726@virtuozzo.com> <20171204230233.GQ2421075@devbig577.frc2.facebook.com> From: Kirill Tkhai Message-ID: <5d3d5f20-1800-b7b2-14c5-895aa4632f2a@virtuozzo.com> Date: Tue, 5 Dec 2017 02:05:30 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20171204230233.GQ2421075@devbig577.frc2.facebook.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [89.178.229.144] X-ClientProxiedBy: AM0PR0102CA0051.eurprd01.prod.exchangelabs.com (2603:10a6:208::28) To AM5PR0801MB1331.eurprd08.prod.outlook.com (2603:10a6:203:1f::9) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 21fa2105-6e67-4520-3ff6-08d53b6b861d X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(5600026)(4604075)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603286);SRVR:AM5PR0801MB1331; X-Microsoft-Exchange-Diagnostics: 1;AM5PR0801MB1331;3:uw3/8cQuaWlXn0SfXH7m+67uWGSZ05kF6gx1XKEaYo9zHI550Njnj4MN6Sp/BcfQHIMQETybmFy0Tryq3YDZkAlK5+71GR7IM5uOeQsM56cQcCiR3OXLT45h5hnajMwUsmKo+2TdFhYZz+elfasDs9/iLxTc8B8JjofglENsFjRyYI6gGx/GM6f8S8whg6UIqHQ7Im/FS9e4WJMW9Si+qXpU4LauFDXMy6iuw+Pp/52ibvR5Lf4cv9DSgs3xfFdf;25:12JU4Hj7WORv7s6RIWJjldnzXEY1mFp86ryhoSU9oS9tLTySKQ7qldNFKAA0p0D/LuJ+HZyvynVDRxwaqhXNdeTTMoeyL2c3O3K4NYelUEh+FhCOdQSgRlIikdi0Kz/Fx8lyqbweVHZRfRuttazrdwZXr9iip0vmJ4eLWLYRoRyyvq7Ls+ZiFzkwxctprCUWIYTOWx9OArlMf2Vs5VTVUp61yrJPSbORS8mnWQ7ku6hJKzwfmf/86ROTJtMQb1Nm+Ubt4xo+wD1DVLYB6RE4mqr1sAJPi3mOivZsisr093mJieXJ1GlYz2VXzv0JhWt9hhoRjNVPJa27QUEDEwsKmw==;31:ZWZvwkjenD2JUwVsQ6fJcIX/yr5At3vXWz4DNLBqokyAWkGog2B3rvmJfaeNTqnnku7ZwHArvK93yFieRa4f+K+yu4reD4P2E2JIgL7IlzzpHng0IfzSbi0246esJDe4GLsoy5e+T5cdzgleihVtq+lhd0uXWdtV77xG4a9dWDD0Jh3CA3k9Q3Ag8+ekQm7vx/fev566OTRNIWLuqp2e67D5/5v4cY6Ux3bgwdRI24M= X-MS-TrafficTypeDiagnostic: AM5PR0801MB1331: X-Microsoft-Exchange-Diagnostics: 1;AM5PR0801MB1331;20:gNY8O8Ip2tO7gVYt2cnVNPFJkjITy8GcdAqduNYrgPo08XV+OCc2vUaX4b5/zE0jPvoIDLNLHijnQghMm+GqMGOQF2z3p9vjW7UTelFGxbn1Od1ylqX6GI1mrH7Wp2BuH5qG7H3EvmvIA6LA5OjTc3+12N6a1iNx3OQX9PERT+tgGq/owh7Aj7tLqLIRgqcCOtqeLHS6G857YjhLl/beP9DpVcYIn5PftdUz5jpOWxXjQOl4NEovCJQ6ZDTVFPT3uAILS0PDIQJOwE9p0iuIGW/uDMhZoUkmExT5Y7uQ8OWDiDKmnQqM5DcH5ZkOO9QF08H0AkK2YNhT+vPAbB3E9v6Vt20crG9Wpvio6FFKv5LQPl8bQNvL3Tet/6Ut35YDHEteHmcemxiDhguj5SB5tWOmrJxGLt4DrAP8zKcEZuk=;4:djtTFqvR9Xo4tPyaWpqWF/sEkFNo2D/iInSl0OtUfl0/mTa3/Af0r973RUSqUXy5V3yTiakgMmLSEzQmNbCtI4S4ufacBzlCQhEpVhv0hYGO5dplZtbzUkpVbMJ5uS7cMzFj4Fmu0dTE3/11YFxb6pHYQ7EXOotDk0FNNfrSLVYHlnTc/qnD/jPEvYuEHD1p+ztd6gKDycm7ou172933WAf1oJAnv+fffrIhLXdnH4HNbgGwB8ou9PLaz8BdFu7teFsCYuMWMD7GUfULhtt04w== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040450)(2401047)(5005006)(8121501046)(10201501046)(93006095)(93001095)(3002001)(3231022)(6041248)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123555025)(20161123564025)(20161123558100)(6072148)(201708071742011);SRVR:AM5PR0801MB1331;BCL:0;PCL:0;RULEID:(100000803101)(100110400095);SRVR:AM5PR0801MB1331; X-Forefront-PRVS: 051158ECBB X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6009001)(6069001)(366004)(376002)(346002)(24454002)(189002)(199003)(8936002)(478600001)(65826007)(5660300001)(83506002)(16526018)(36756003)(23676004)(2950100002)(316002)(47776003)(58126008)(65956001)(81166006)(65806001)(2486003)(8676002)(52146003)(68736007)(66066001)(81156014)(6486002)(52116002)(230700001)(6246003)(31696002)(93886005)(86362001)(229853002)(50466002)(76176011)(305945005)(64126003)(6512007)(31686004)(7736002)(25786009)(33646002)(189998001)(54356011)(6116002)(3846002)(101416001)(6916009)(6506006)(105586002)(53936002)(97736004)(53546010)(106356001)(2906002)(4326008);DIR:OUT;SFP:1102;SCL:1;SRVR:AM5PR0801MB1331;H:localhost.localdomain;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtBTTVQUjA4MDFNQjEzMzE7MjM6YTFZYndFeFhYb1grUURhWWl3TWVwb1Q3?= =?utf-8?B?SDZPSHRrK1FTeFhTVGhCTmxNamxCN0FJTHl2V3R6dEdVQ2pHVUwxUjFwdTIv?= =?utf-8?B?WDczLzU1bEpsUzhQdzF1Rmp0UENIei9jTEpYWjFGRjFoUVpJUCtpL09IVDZD?= =?utf-8?B?bFVaZGZnMTJxUDR0elEvbWRLRlpOSFdZK3pqZzJXL1k4OXVEN1JNZW9uN2pS?= =?utf-8?B?R0Njd1MzaTdjcGRRVkZNNFRCMERQVDRkaktHRG1vdCtwVXVGeTc4YnhYYVhG?= =?utf-8?B?QVladDNjb3BUOTJTUFh2Rm0vb3UvOVR6VzVRSXJVZlZSYi9uL3FYVnJnc0kr?= =?utf-8?B?T0liTnEvUFVDd1RYWEZGaU5RbGw3dGRXUGVXM0IyMGsxQTJTckFwSnYvdFc0?= =?utf-8?B?VDVuY21UMGNIcEVGMVdxYVlMMGdyL1FNajUwTDRrS1Z4eHY0VjNHVXZkQ0N0?= =?utf-8?B?Mk1kVXIrMU1qNGJtRVZ2dXl6R3lCM0lXbEhSRzBrZ296MXhDczlDdmVueWJ2?= =?utf-8?B?dFRrVkpVTFdxYnlO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MAINd+/KAOdP+RmlcLcqi2pKTCmrtYBPekfSFMKGZsJW/tE=;24:fvOrpY8fw/nsFbifeD3DMGGb6pD2h7m31Rqll6ZnyhxNDb4bs0EwHacx8D018Tri3hPMdyar/lhnynEBpi9lfzoR86XZ4Xz1UOpdHl57yP8=;7:7M24oGP3UQDgEwvD+1skCK4oQPlM9RZ3bV0lD0v5KVug1cHyjazDzUQ0uaj7ZTK+H74yj2GHrAbiqNx8CU0lm9Alv/t1s1vg9JvYyPw/H/NHwOhcWS9uyf55X1Cx7ySx9lTiRmyenK2GHlWRN25tO7IZBdGaYg0Udx99FL6C72KpTrm1FvFCPlD+QNCZGuUeKiPaqLWgV38xvi4IfZjWS98QWRqHyzSf7c/KX7wAOaWntvV5AZSkTQZ5meIPxImD SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;AM5PR0801MB1331;20:YkOWelWheH8HvljTPuuGaTdG3DD6LiyXZSi/pTN44nDGQojDqVbe2/2rARLqb3/lGLD5mWBsZuTdMCZzT6XXPd8Hwy8nhXqfCR6XE6W5BE9GqvxgAwDlGef76LtZyq+Ox1pmxNhZ5ru8Os+zZJ+5eITC+zae7LLnXHhKQhvfAwM= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Dec 2017 23:05:33.5240 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 21fa2105-6e67-4520-3ff6-08d53b6b861d X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0801MB1331 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1355 Lines: 34 On 05.12.2017 02:02, Tejun Heo wrote: > Hello, Kirill. > > On Tue, Dec 05, 2017 at 01:49:42AM +0300, Kirill Tkhai wrote: >>> If the only reason is kernel memory consumption protection, the only >>> thing we need to do is making sure that memory used for aio commands >>> are accounted against cgroup kernel memory consumption and >>> relaxing/removing system wide limit. >> >> So, we just use GFP_KERNEL_ACCOUNT flag for allocation of internal aio >> structures and pages, and all the memory will be accounted in kmem and >> limited by memcg. Looks very good. > > Yeah. > >> One detail about memory consumption. io_submit() calls primitives >> file_operations::write_iter and read_iter. It's not clear for me whether >> they consume the same memory as if writev() or readv() system calls >> would be used instead. writev() may delay the actual write till dirty >> pages limit will be reached, so it seems logic of the accounting should >> be the same. So aio mustn't use more not accounted system memory in file >> system internals, then simple writev(). >> >> Could you please to say if you have thoughts about this? > > I'm not too familiar with vfs / filesystems but I don't think there's > gonna be significant unaccounted memory consumption. It shouldn't be > too difficult to find out with experiments too. > > Thanks. Thanks, Tejun! Kirill