Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755001AbcCBUKH (ORCPT ); Wed, 2 Mar 2016 15:10:07 -0500 Received: from mail-db3on0077.outbound.protection.outlook.com ([157.55.234.77]:6224 "EHLO emea01-db3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754591AbcCBUKD (ORCPT ); Wed, 2 Mar 2016 15:10:03 -0500 Authentication-Results: spf=fail (sender IP is 12.216.194.146) smtp.mailfrom=ezchip.com; ezchip.com; dkim=none (message not signed) header.d=none;ezchip.com; dmarc=none action=none header.from=ezchip.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 v10 01/12] vmstat: add quiet_vmstat_sync function Date: Wed, 2 Mar 2016 15:09:25 -0500 Message-ID: <1456949376-4910-2-git-send-email-cmetcalf@ezchip.com> X-Mailer: git-send-email 2.1.2 In-Reply-To: <1456949376-4910-1-git-send-email-cmetcalf@ezchip.com> References: <1456949376-4910-1-git-send-email-cmetcalf@ezchip.com> X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CPI:12.216.194.146;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(6009001)(2980300002)(1109001)(339900001)(189002)(199003)(92566002)(4326007)(33646002)(5001970100001)(586003)(42186005)(11100500001)(36756003)(50986999)(106466001)(5003940100001)(4001430100002)(5008740100001)(2950100001)(81156011)(19580405001)(19580395003)(107886002)(1220700001)(76176999)(1096002)(47776003)(5001770100001)(2906002)(50466002)(85426001)(104016004)(48376002)(105606002)(6806005)(87936001)(229853001)(50226001)(189998001)(921003)(42882005)(1121003);DIR:OUT;SFP:1101;SCL:1;SRVR:HE1PR05MB1530;H:ld-1.internal.tilera.com;FPR:;SPF:Fail;MLV:sfv;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;AM1FFO11FD014;1:yGSI83eq6+THvtDabhsTfpcbQ67dpwQT20pJzxWYg3iQfTgB4ciXILB1VMaxvWGdxx8FEZdfR8P/FcnTalt4bbq3QpOVFuSlfmkir7k4qY6H5/t5Hi7MknGIdeK+azOCkOBZTeNOBIFMsj+U6M3VfqLoC575HzTBtFYb7TZ7JqfTyD5MVqD0rKh3fiYVlv62bsPM1WDmpptmE05X65AaT6UgkF6rf9DlPt4DIKfncGXiBiZ3B/qkpVMPa3Ap77U0uTiqUbTRM4Qscpisg4r5n+cHkZ6xAb5VO0ocNm5LvBeXJYfRVc49nnSR8GNvqyuGzz10FIt2JqqDjKidAfTw0tiH6Xw7lqAhEgPqIAv4hMgohOJutmF4uTyh+qNCBgYKRm7a/JaPNQTsJcRVdYFU6MknJaSXYKSLDQXLNnSRM0BIvKVmUI/0IGMeiNsfjuUdSJ6VFVfxFrQEBg/L7kFsiyjO4oqlK/3pFC474mygDxlvYZTYOo4Tw3/oSB9yXTaL MIME-Version: 1.0 Content-Type: text/plain X-Microsoft-Exchange-Diagnostics: 1;HE1PR05MB1530;2:2ekftKPOfl/dOXPTmk2EITe6tScMj1duYgG6BVFLP/qsByRKRlA1KQY1rzgYB5TWZYUOOSCARPs21J5QEuica+LOVUtpwCYeypijSFvkDCvzWpxcZ2e9wiKqjFumHZqhyqaGEPX+SkLaWdGfxxwdfQ==;3:hDXxPNnfqaGamYVWp43m5MTFrl5788jvUQncGMICjrTZBBcPJvB+qF/ZnSS9V08bRffqlCJTU2uBQcrnFZmTqDeH+3Tdfxrr6crXCg5zKlzxGlaoW8IE40WhJufWB34QOpbQisdXBaZ378Xs6guPxoLAxgS85sDm5mFFaiclr5Q=;25:9UkIKg0voK6nS6elDtwZOOej7Xs++bdL5JW2aekWnX8t3QjN5FNR/8yXIuLozkIwbXj2EKMzauSq6iiRYARBI4yUw+CtFqdbm1gSD3wqUZ8ash+y8qZtuJewPXzVCGL6Bip4ZLXYtHPYRGA63Utr6Guj9/8c1U0vaS3dzAcXwNaC3FyiLZGWhflwBoabaJ29bgMhM+Zpu7Sdc0oMXq3Nx12p8r1so61AdphYT2V+d4yDm/+s3fN0wFsunjtOqMWEfCwPHnuTw+j8o0eZAocktlTflicVs86YcjXQLqvNyJIUaAlBRbMGGQI5wIE/a9vLD/PFp6Iy1sfdi/dF7NdaDQ== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:HE1PR05MB1530; X-MS-Office365-Filtering-Correlation-Id: 7a0f82f0-c108-42dc-6bd0-08d342d6a0dc X-MLNXRule-EZCH-Linux: Rule triggered X-MLNXRule-Acc-Dom-4: Rule triggered X-Microsoft-Exchange-Diagnostics: 1;HE1PR05MB1530;20:jaLwvmM5PdHY1lodbdEsWTwr4HRIdWv2iPLLU811Mx9c0drifUpjbcSRzqQ+DS45r4GBMZNecE9XTIEDFHKIbCYRw9osoRDVkNG2cmPxp8BfLgnrfLZ12DigXQMk25sonYlLRVIHCfF5YI0gLz9vszAixjznMpCdggQhAmB2Ttw8BK8V76yzxxTyDVtRe2qp1zInWkY7tL03VgaXZNLk8tSuNEPmklqcPvl8nKEEqwn6s/XOKaUyJpeAj8zDoviZTzv8tHfreg3MKCf92W3lVBSnV5aUykUMOc5bd/0UDS7bXYlAO1fplrDukazBE+Z5kxQmqcL8yK7VIOZRHRW/3DsAOMwx9e/DzQV45ruZoj4ucONAdiADLA/kB1QrIaj/hoE8SE4sPnndNkjZ0WHHn14aMV4c6MEfspZUn0lCNes2slrsgh9cQ1h6CgwQYm/EWwcotc46lq4blHuujNXIMxwcRc8ZSHIuBXwWBCkAAhAK2bswFZWCGzLEGituYOz25vC/XeqZU8PoW6qsmfAM6W/Fb74Qy0FBrAACStQsaOi59/bzzjpOjpv0sm3tLHLV4auuLw/zrjsDdJXatGmHmRoUFscUxZ4AaUBCbE0Dl+g= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(2401047)(13018025)(13024025)(13015025)(13017025)(13023025)(8121501046)(5005006)(3002001)(10201501046);SRVR:HE1PR05MB1530;BCL:0;PCL:0;RULEID:;SRVR:HE1PR05MB1530; X-Microsoft-Exchange-Diagnostics: 1;HE1PR05MB1530;4:Okb59FaKoCT8vbGlRJ1Mc1/knkjYoc579HBJZk+zzu/tjV3uyHbAOIiqic++slL+s2jz9TYODZoJ5cfKryekq+jPuLlh3AVw/h6c4juR2ed+Irjk40JIXy+NTzLTACj3UZdNvvRGGoH3IK6S0iJ2vsHAIWjXGECjbPG0sauIq2RKeBAGxnbwuvSbMWD20qjudQuDh1SW6qRikafO6Ih36AWaR8olOPhfmWCDM3u5n1YulklD4wrJ3HdP22Bjv9Dz34h5IcoiodBkVwtOsxU6uoTtCO50QUS4yTEeda0HZWcUTK7qXoxkkYYBUKNG/ikKhYQdx5qZ7srsF1Az2Jnf9PKgzVst2K4zmp0YaLTMF2rT4SfuKQhz4ZR+ltLFMYCIyJ/98kBECPp/orFr2RvjgYBYO/E+0wfU1XEzqZXyXPfZeE40kbVcxuki8MclRI9Id3tSdK4emHxjhB1Q6V940g== X-Forefront-PRVS: 086943A159 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;HE1PR05MB1530;23:ZZAyHKWKmnd0RwgSbWZ8suFbwyA7W2mgoKSnBlmPS?= =?us-ascii?Q?y3gU9wsu1TC+88hlZMi0Ud5mSDCloUlQIRGQ0mFVrb2mtIiYrTlRbTNLVjCW?= =?us-ascii?Q?tj/FVR1OVsnnrEtVzxKwtNtnJ/YjS5RzAuSAfmxjoTLo2AcwoHbs4PJ1uCJ2?= =?us-ascii?Q?SVyB1lfWeXBHlGJ0AhO3BRiY++p3kbcBnZtEvr7FH5DXMIUM6IyWVSyN9vDz?= =?us-ascii?Q?Bj5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ozlJBxPhq80eTxxM6?= =?us-ascii?Q?hk6bQnPqxm0RetmHVrpwPL+2lb/oRb6?= X-Microsoft-Exchange-Diagnostics: 1;HE1PR05MB1530;5:CDG92w7O/rYnSQhCxkDQ4i0fOf0/HsVCfFtozsDe+sq45Pmvr1fGpz8y96VOqfNxnuu1oXJzZ5KmkRDay1PkgpNol++amf4y3tB+XEUFboJzolxLdY+hr6MnweDtVQVUCD5Iicr1OQ62pEW1fXyfVw==;24:lP2Ifd69nrgsECiLHcizqpGkMKOqhLaAy7YxYa9xHigvcVFqeEJaWzPdeHdagZiXD3gOy/7ZcRbqZIp1z5lakH3Ihe1Qn/zXxo+0FSopHn4= X-OriginatorOrg: ezchip.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Mar 2016 20:09:57.4238 (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: HE1PR05MB1530 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1935 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 084c6725b373..ff569246fcb5 100644 --- a/mm/vmstat.c +++ b/mm/vmstat.c @@ -1469,6 +1469,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.1.2