Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756567AbcDERi7 (ORCPT ); Tue, 5 Apr 2016 13:38:59 -0400 Received: from mail-am1on0071.outbound.protection.outlook.com ([157.56.112.71]:31168 "EHLO emea01-am1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751668AbcDERi5 (ORCPT ); Tue, 5 Apr 2016 13:38:57 -0400 Authentication-Results: spf=fail (sender IP is 12.216.194.146) smtp.mailfrom=ezchip.com; mellanox.com; dkim=none (message not signed) header.d=none;mellanox.com; dmarc=fail action=none header.from=mellanox.com; From: Chris Metcalf To: Gilad Ben Yossef , Steven Rostedt , Ingo Molnar , Peter Zijlstra , Andrew Morton , "Rik van Riel" , Tejun Heo , Frederic Weisbecker , Thomas Gleixner , "Paul E. McKenney" , Christoph Lameter , Viresh Kumar , Catalin Marinas , Will Deacon , Andy Lutomirski , Michal Hocko , CC: Chris Metcalf Subject: [PATCH v12 01/13] vmstat: add quiet_vmstat_sync function Date: Tue, 5 Apr 2016 13:38:30 -0400 Message-ID: <1459877922-15512-2-git-send-email-cmetcalf@mellanox.com> X-Mailer: git-send-email 2.7.2 In-Reply-To: <1459877922-15512-1-git-send-email-cmetcalf@mellanox.com> References: <1459877922-15512-1-git-send-email-cmetcalf@mellanox.com> X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:12.216.194.146;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(6009001)(2980300002)(1110001)(1109001)(339900001)(189002)(199003)(586003)(87936001)(4326007)(50986999)(76176999)(960300001)(229853001)(19580405001)(48376002)(92566002)(50466002)(85426001)(2906002)(19580395003)(11100500001)(5003940100001)(42186005)(4001430100002)(189998001)(1220700001)(5001770100001)(36756003)(2950100001)(1096002)(5008740100001)(107886002)(5001970100001)(33646002)(6806005)(105606002)(104016004)(50226001)(106466001)(47776003)(86362001)(921003)(1121003);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR05MB1694;H:ld-1.internal.tilera.com;FPR:;SPF:Fail;MLV:sfv;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;AM1FFO11FD040;1:h9eUcWaKpbehwBvbPcpZE6d1S9E+EtWmTYc55tYYCPttwdwhd41O1ZGCYkzCLWescnYoMxmtqDBnfaAw9rL+ho/KbhJaNRnKwd0PQ3gxn6CRvR7MJyoVQufGdsDjxDf2DOnHiQUj5NvN6qQuYI/HRy/ZDY4emnOxqYjtmQiEkpw00aHcj36PeX5IOYACUnGmbHt2SWO07Haivv95zI10BmeTsDNgzOPGt/dVejq1xZdStHTLieqx8U+vCcuZkd3hUkzAQGTvNGEjAgky8LurqzmI01tzFQQJ1JYozHIci48Zx86IYRnuX1hlR7VFTld2jcF9o0lq3cSom2nwmi1G/zVI21PJa46uk4rUAWdUIqyiOO7asoGubSrQkaQHb49MLOTvFuBgxHmcHIHil75fnZLZH7gMykgg/f2U2/VAnjFAECEjErqU0i1y/EViytmmnQuDaZr3PBBVDmJxwlKcyZwUZinkkPs26vIq+po9saAKKgPCuVzI+CMPErn59KQejelmQWxgINUhBOLmdFNdj+AyT4IuxaQ71MXRz1BvID3YK0jBv6B3433frFYXG3ImM2/Ve56HauEFiBfOHoyxsitHnLi6BjjYUxpS1HFWBKh466xhPY3SaDkJJBa8oCkT6/VrnKt5Qpl5wZxaI31ADg== MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 2411cf08-0d03-4b13-6b09-08d35d792742 X-Microsoft-Exchange-Diagnostics: 1;VI1PR05MB1694;2:Z97/DrjL8oOWtNCbxiMMzgkIXgdn8KGi8lrRGYk1UhLphILGaprXwjwdXECrA+C8Vi0ZrmkJ51+cAbV7Y2FzrEAVNFmNvf73zku72JduR9riT4YueFsQK/vXqBjp36gnBsQn8lPIfXD5FmDCKLCvj4dev/SGd+ETAu+B23U98p2xxoe/XBehqHB2+qaDLhtD;3:vEes0goVnpOb9RZsplPRRhzRuGtL/B9bDTr/46Bu1FhK3xwxqOhE+v12iLTLzoX9BAvdyzPHXQHNCjT1XU4j1Grj4KAwFRXAs1st8KoCx4oRfn2GGs5CZJsv1yw90GW5XMmKk27+lIDfhzdBcpoCBLaLEK+kyHZR0xfig7ZeGenF2vOebqI4nUhobws3al12CIYRt+MPGcIiGu/z25YDX/aTyGJQ5jFoRX1p7jmAmsI= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:VI1PR05MB1694; X-Microsoft-Exchange-Diagnostics: 1;VI1PR05MB1694;25:W5oXN4HAy2xkz32RapQLV0n948FA8ARjRtj6PfD8Fh+MAsa+ngMR03VlLMShC9OcA1tfUnFrIEXqje9UMW5kNXdJyEDwY74zFMO9dkBIeHH/cshLw2XtNC8dVxtwuNunIdDJ5pF+lOGxJ/E4xbzumI3zERqBPVAB1GNapeBNHDY2W7wF1Tg6IB0WKbiVuf3u1VWCsfg5UerMdZrIwNT1jod0Ybh/UuelqLWtGKUaapT86nonPmIVPEUtFDwaQTTQ7G29TEU6S98GMDqCq5uWgC3KljUD9mdqQIYcVNWFa7cesdI9yXR3tm1Qls+lz9DyYA51Pd+OaC5bkay1Nw/ntjjzSqeadzK+poUvZeKE7q8LU9Zpb29eXUS698hWtdw4KOUe7q1jI7RWXR2w4J57m0cF5luz5ImoyzgyAyMY9ChoUfwWgBdEnJufYmoqD9BRAZx7lvyqFEvSpO4G4Sgo7SY/7HU8sH5ufD25qq0GYFq9+OGFvhDvzxr02oUpfaQkhL0urOYLCYMwmvx03HXum7a25uubm9o0Bl9l0dKCsq6aiVmRXGntjpkzaplkBFcJw6LtkbUndVuD6s72XXC0OCPs8Up31dmjHhnEIUzzKo950HHCnirCWu32+QqdUkqlkAHLxvWOvqSOJ6xluTw7ag== X-Microsoft-Exchange-Diagnostics: 1;VI1PR05MB1694;20:WOwDpvnBRJOLZuq+P2KcXOcfYgj8usHk1v+LLPTvtIXLgI4An1gqYQOXprSq6WQMeK1inNYHVBO6l3KrdCMuQFd/uKAPLRH3rTHp/qeHrXzeDGWyolV66NWdnkD+MKJmzTpw0GItoRq+GJtbxPaYTCfOOYLOWjACpx7jJBDBDKSz9QRJdWff0TotBBVI9NnlAQassMwb3kPeBxs8QyAciZMlsu3Md+rMwAwlEAqw3pz0hUn/GeksytgISN1yHRHOPDC7GakQR6mUemMJeDrwlyzm3Q0rEEJQNDIySh4denfEzYrlUiOrIRT411fhfpy7nitjHvzHJkaBYmw3bPcycCk2262ha96vjMcaLUsVW121kuVOZ9ND/eVyR0ptCxP1Q6olYtUyj6GFMR9Wq/xXUUesC9dkt/6pr73M0niCKgn+khNNasto+SmF2i4Vk6+oy7a2rFuGFQrJDFXlI/4OVk8Aa6UIjggR4j4GfYcoVLIFrrVgvwo2M6uVqUArXg6F X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(2401047)(13015025)(13024025)(8121501046)(13023025)(5005006)(13018025)(13017025)(10201501046)(3002001);SRVR:VI1PR05MB1694;BCL:0;PCL:0;RULEID:;SRVR:VI1PR05MB1694; X-Microsoft-Exchange-Diagnostics: 1;VI1PR05MB1694;4:aG0lNFS0KnjBoAB8YBmly5kAKPovK3X0Lr00BHgJ6CODvRO7eA/L5ve+di7LZ43IFMgSTrF5I9EVsYY17vGY9CYIqCIEpzIxEie/m66taQOrzqp8L/jEhu+NfPSJ3ul+4Cdz8faPMcDC7RIIFNstax3TQhi2IuHlKhpbA4P3dsSK5orlM6vlmf2r2vWjh3T3Pg2bu7UV8pXQ9FSjR6S1eJrI/sIAS+rgzd/lqLf+aX8BDUgp9yRBBJwV4/EFZ2QL1AvLZIA4pDtI4H1rsXY4JeT422MbklEu8Ms++OnAG+yeONLYHajXgNpNQnu7R7xEBDK+BIR65jbrrxafP1v1I5pKfiLplthVpfuhp7tlpEwGHYVo8Yy4qHbbHtyjlXJ8IUSDI8RcIre1kBCezQLyU70hQMbRXnKf8z/xc7krQXHoHfJG7iR+XF4kdqNJ77vd2LmP8jIr6LIrUGHLWOCt8w== X-Forefront-PRVS: 0903DD1D85 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;VI1PR05MB1694;23:PkGbeFPUK470awSNykb1t+ZpJClH6VK/qeSj2jX6s?= =?us-ascii?Q?qkyEODAxwu+OQeI1k3tJ5SnTQ2/dmUgStAXS74ANQv/bQYskfrdDZ+vcjGZj?= =?us-ascii?Q?u16qXq4Efs5XmzlCMNe6dsTlJGmQDaKCjsAzPecJ2km2j8+aqUJT9NQcSIA8?= =?us-ascii?Q?dL/JhFrcq6NgMqe641ae7+f959l+bs2vBaXuCvRmbyoe8j6Bxk9pEdJblKxx?= =?us-ascii?Q?ciP1J8MZw1yPSJpyQbBGyzu8oWyJghR9dwA8J+7oQlr8DzqU6xLzkOaCqJb5?= =?us-ascii?Q?GTmGSyO0ye0fTnmG11XaBxtfspVgohohxs3q5aeHns3hpDeGCNI6KaYAkd/k?= =?us-ascii?Q?HRDfxGYeQgllRrAoajdhH8PzQ25O6ZjWv3ZMcl4qGO7CLxpFfyEGGCHcnVrF?= =?us-ascii?Q?XfubqO4JhezhSXcmCpwsIgMSr1GW9pk0esEkiyFFg6IxRhK3eq6hoD04ZJwC?= =?us-ascii?Q?/ZjTzpiu925Z98w4VgVngCy+lwINxmekilqWkB5bXSsdKqydfssJlAyROyxR?= =?us-ascii?Q?MP43JdMJ3esuN2cZ56tg4cLHOGGhOxecFTQgd3sUM0sXDVG5XUTz84pjAnAT?= =?us-ascii?Q?IzxZ69gN3xjzpGjBtzj5/c0wY1xdNhDhGeBaKsSwWkd0z1Mf66y/fLxFqT4n?= =?us-ascii?Q?V/wpn2lsxIZpjtigi0Rqw4tNno50F9e8EdGp3rgsDEjPAsv8XYUV8T75f52n?= =?us-ascii?Q?pX2svKncOmwu5S2AefhgwD6wFcOmQ5skXD3lLtiQi37ZsOMPSwtqWHeMT6k5?= =?us-ascii?Q?8arqJ4n0nomYLTnAKtfHu324AER71tknC8iDcfkWfJvpzpDkLFqvkqlvHNz6?= =?us-ascii?Q?aIYJP6Uypdk/pG1Dz6Q0oQ4TZ1cW7LDHdGQPMjYqNyOGburqe4TLyP4/oopf?= =?us-ascii?Q?JBoQY/gHe5SAPT6MC+H8LYAMZCg7ZLIAI4rTxnBObJoyJTXVwUxvEi6Fgbb4?= =?us-ascii?Q?CbjbUV0LY5aYZ/uvM5THpS0A9bke5W7Ps3m47kzojdgwMh2PtKezxHrnpYX0?= =?us-ascii?Q?YN7+fMClAay1wbsTkSK8rNBx0kaOg539aqO38Fh/9Ol1NUi2aZbWxuWjRUJG?= =?us-ascii?Q?I+JgUe/4jOc/bufpQG0iIgvtnZohrOZ0wbt3PY58v7vTSYV/y/7+nAeemkcp?= =?us-ascii?Q?H/GYajLWtkzS0M/Fwe2CsdIQqS1V1wjs0uH4xvZAqF65Nm0RcUVMQ=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1;VI1PR05MB1694;5:LtPYtaHEm7hCSf7BfjN1qbr54h+6+0dXDimu01vlMd8cIA+cdsftEzOtk4974uewnwufUSnGwOF6tyXFjtOhUzE63a+jDcIUIbd3hmOoQ0vCXYgLmbONlphb4gBWyU/1qHwSTUtdx8GGxOCkfRF1xQ==;24:Y1qUvsZcqaAHUES5yWV8OP5xtkWfa6fkE9SpBEU+1rsD/GNBJ+a3vdOck1kupytee0DqRtrVcjwFVB5WlLGoqUgOvbu5vkFNt1FBlGMsECU= X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Apr 2016 17:38:51.6250 (UTC) X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=a652971c-7d2e-4d9b-a6a4-d149256f461b;Ip=[12.216.194.146];Helo=[ld-1.internal.tilera.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB1694 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1937 Lines: 56 In commit f01f17d3705b ("mm, vmstat: make quiet_vmstat lighter") the quiet_vmstat() function became asynchronous, in the sense that the vmstat work was still scheduled to run on the core when the function returned. For task isolation, we need a synchronous version of the function that guarantees that the vmstat worker will not run on the core on return from the function. Add a quiet_vmstat_sync() function with that semantic. Signed-off-by: Chris Metcalf --- include/linux/vmstat.h | 2 ++ mm/vmstat.c | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h index 73fae8c4a5fb..43b2f1c33266 100644 --- a/include/linux/vmstat.h +++ b/include/linux/vmstat.h @@ -190,6 +190,7 @@ extern void dec_zone_state(struct zone *, enum zone_stat_item); extern void __dec_zone_state(struct zone *, enum zone_stat_item); void quiet_vmstat(void); +void quiet_vmstat_sync(void); void cpu_vm_stats_fold(int cpu); void refresh_zone_stat_thresholds(void); @@ -251,6 +252,7 @@ static inline void __dec_zone_page_state(struct page *page, static inline void refresh_zone_stat_thresholds(void) { } static inline void cpu_vm_stats_fold(int cpu) { } static inline void quiet_vmstat(void) { } +static inline void quiet_vmstat_sync(void) { } static inline void drain_zonestat(struct zone *zone, struct per_cpu_pageset *pset) { } diff --git a/mm/vmstat.c b/mm/vmstat.c index 5e4300482897..7a1cfe383349 100644 --- a/mm/vmstat.c +++ b/mm/vmstat.c @@ -1458,6 +1458,15 @@ void quiet_vmstat(void) refresh_cpu_vm_stats(false); } +/* + * Synchronously quiet vmstat so the work is guaranteed not to run on return. + */ +void quiet_vmstat_sync(void) +{ + cpumask_set_cpu(smp_processor_id(), cpu_stat_off); + cancel_delayed_work_sync(this_cpu_ptr(&vmstat_work)); + refresh_cpu_vm_stats(false); +} /* * Shepherd worker thread that checks the -- 2.7.2