Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753949AbcCYQFx (ORCPT ); Fri, 25 Mar 2016 12:05:53 -0400 Received: from mail-am1on0126.outbound.protection.outlook.com ([157.56.112.126]:52537 "EHLO emea01-am1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753525AbcCYQFv (ORCPT ); Fri, 25 Mar 2016 12:05:51 -0400 X-Greylist: delayed 852 seconds by postgrey-1.27 at vger.kernel.org; Fri, 25 Mar 2016 12:05:50 EDT Authentication-Results: linux-foundation.org; dkim=none (message not signed) header.d=none;linux-foundation.org; dmarc=none action=none header.from=virtuozzo.com; From: Andrey Ryabinin To: Andrew Morton CC: , Andrey Ryabinin , Alexander Potapenko Subject: [PATCH] mm-kasan-stackdepot-implementation-enable-stackdepot-for-slab-fix-2 Date: Fri, 25 Mar 2016 18:51:39 +0300 Message-ID: <1458921099-964-1-git-send-email-aryabinin@virtuozzo.com> X-Mailer: git-send-email 2.7.3 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [195.214.232.10] X-ClientProxiedBy: HE1PR06CA0045.eurprd06.prod.outlook.com (25.164.28.141) To HE1PR08MB0363.eurprd08.prod.outlook.com (25.161.116.150) X-MS-Office365-Filtering-Correlation-Id: 89f38e10-307a-4648-0d41-08d354c55799 X-Microsoft-Exchange-Diagnostics: 1;HE1PR08MB0363;2:BzX3Sln0b0qtVVnP48ASoz6GZheIVmA/1vtkag0EY8Ez755jMRp0kkmZiksEtR3FPdVGLDnAYsvXY1zCoZ17S2ZJTqqv1FN9HNqVTOEcZ3JfP19hzqOJSj5Pci1itO/PIYyfsV5W4bYpvjEZQP5o6Y5DVq0kcOQkTEfi7wy23X4BzVBPx6q4cDI0jSXrHCq7;3:It6WDXtTR2hCGTXjBVdEiGqz4pOX2jnLLVjVo/TShUekdNABuO9qqiwLj9of9J3HYN5EYhPC/7waSimpDQPK5tK3zx91PSh+hjCGWds36tunV7a1Keo1IoSp9Ay0qiMV;25:qqHwmQAbTl5aVAK8Q13nhAI63Ypvb8yGRW130rnNKnICFTBbFlA7uODSaSGUWS/1AJyFgfFBhxmi/L3pFLE82z6yn/u3Vv/Uqw43BFIq1tmkUY3eFyYm3YL9bXsqCmaZfDJFw1UztAVdfLBqscjKIDudrUO6Uqfw9EkUCZXETRACPVnYLx2iyyyXO4UMNWv/vftOPEPhYjLOJXMzxaHeGx7Mwp+0wfCy7qfne2ehwYXFjPn+7MmPbUebPwHULBGtrvzIQZWr2Uq+++81L58Gn7ah8uqVL64xAz2ENhFcSQacUqX0SGmrGPgecHlp8zkOg5O9jdyLHD/tdIlZreY7/ch/EN8LasMG+gzozDitX9dCJ8w7JT9E/LswcELw3oKRUFMMrUZgxzjMqPq7aTRfylIIlTQd2/jHVNB3CUop3VwvTqA8vtA7LV5PW9YBFrpDxOBw5Mls+EPWe7WY0aSCa6P+EDNzS+707nlzKtE29/0i+vsbv4jojYyAYGj6VQuyo8iuMNEMChgsyr+1QvHO/tSVwReO69yqAmO9vFBTlJTFxvc4fcWLglevXj4OhHQE X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:HE1PR08MB0363; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040046)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6041046)(6043046);SRVR:HE1PR08MB0363;BCL:0;PCL:0;RULEID:;SRVR:HE1PR08MB0363; X-Microsoft-Exchange-Diagnostics: 1;HE1PR08MB0363;4:x4HpkqUhcjLcCBpT3Zez+62IjULcbci6xcZVQRc6P27OD8nxCPcneehCoecVRg/LC4b5Z+aI7+ShT8ooAgXHby+34U490yH6N3tMiR+jSPbMXhaX4YH9lYi9f4zU7Ox8LAxIAE9iC/l1UuwpX7ADmKArTBSnw1k4/IaUXnVkSSmP+psdDTPB1KZ8IID0mEN3pyr4mLQkR6xaLEjokDGuZaK4F9mCXQcUTrowpdkGwxD41b73EDiwfh8sVh2q7BmDRE215quSM/quTE9Ea0sHef1xkFXAUszWGqr2NH4lyZHckhzdfQybFcPxVH+Md+4WFjSfoEz2/Ut0AwWF4M/w6P9kTVTAtAFBZ4A+3CeinoXCWtusiCiHGkszvMnTy5RDEuYJjb7YxE/Yu8GqEAgydbjbqFuwiTB/vLC4oxnxVic= X-Forefront-PRVS: 0892FA9A88 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(4630300001)(6009001)(6069001)(77096005)(1096002)(47776003)(110136002)(81166005)(66066001)(586003)(6116002)(50226001)(5004730100002)(3846002)(229853001)(92566002)(86362001)(189998001)(5003940100001)(5008740100001)(36756003)(19580405001)(50986999)(33646002)(230783001)(48376002)(50466002)(4326007)(76506005)(19580395003)(53416004)(42186005)(2906002);DIR:OUT;SFP:1102;SCL:1;SRVR:HE1PR08MB0363;H:localhost.sw.ru;FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;HE1PR08MB0363;23:GHBHsxgBaXQOMF03kepBYXqIOJ5mhaO7YtS88APubaVwJgZbVlbm3KR9aZay6AgG1X0CGJXkTmXHIx+Ik1i1tm+xr4WyqmccbUUBiDWSvWRkb6ISIV8vozjVwULKV+DlTySYnLGZ6aWffFI+6Tmt193wtd+8JpiyvHq7+f0AsvDJ1rrbU0nA4Nqw78aJn1eP71mbKkq3nbOoOBfL5hEQidyKKN7aed2iarol8JcGFOUEvv/eFvP/L7NxEHfdLfFEr/ng7KOzZAcul+b7mPrga7sKOkPiJAPnO2eZwkSXjk3OThwV84bcx+aT8ZPrp9wBoxqdjEoq8Hy8ZpHgMMDpKat44ZWLTtIuoYiKbdi77m7ZfC9SySh7yKTyMgOXnub0+C+yFcYuy68VG8GNG8AXIm47KUBmaFIjQPXw6c3vR1BK+dsUllGSHKQvycglrpF2/VlRtLD+YEP8PTcSLEh+bRrQ2daVGYutVrivqlL8UuRHGV8RjugG/JcO7vpBEoVd/QcGFhmafDZpOk5uhc/ZJKpqMirmzoBBEZ+UFqzLHvv8Pm5ch1FX35xl3hWZhs1GRifsttO1LvOArO6/FMhz5Dlj8FxRsNGInZrSpV7dSvVtSCLdF7iez0EFlDb9tqQ/86fLTV4rQq5Xmc3nRkzILnFM3JJk/xzPCNHUBdwC/CLCchLJX9E4B/JvChscRCtWMvrELdrsHii1aWC68siRxGzUx8sw9kRBlYq3A88jcdJNkvih8XixIhGi91w63J0Ih5HoB6kaexVFHESF1geCwCfPeshxh4trhM8BLQf4ksNkAZZ79fGryQbxj+qte2j2PFIQCtSsNXGQdKL8g55yRxmZ0dyKEeWubeDWPRiO0q2DuGQZTiFHG9emaGQZXYeUaWg8kW/Yizg1i3+o9BPtZA== X-Microsoft-Exchange-Diagnostics: 1;HE1PR08MB0363;5:jpAo9wDIDGuhMqZ6pfP8Lxdejz1HPRp6OtMvY8KzX1EIU7Y2V/3eY5pU4pYSRzw4BAf4OLbA+kwjHPnnciWjQBKvC1XvDjOkggqSGgFJf3ti4XMEe+ZY4ynR34gW2ECqmWDQo+8XhiS+M7cAURR+QQ==;24:s3VODRxdAjUUagE9U5epdne1esoo0TK77U8C1t6d+tcLVZqFugRFLSJF8GXSVUhTvmZLWy2eXEnj5byLH/WxK1hiCTyrULyi43XCsab+d/A=;20:+xrYr5D2kEC86tCroR2fT/UTq/8rfpr1gYMXI672jHo1x2s4Y5ZFSI6Lo+hdfLfY64yH3syUEddtADrnRQr8pKk/Ts4G8AR21zYh3J7UqEXrRjfRdhgOyJLKj52R67H9svRVfzpHjhK2i/OF3pVcTLZHMT8YgvtGDfmlcIwg0MA= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Mar 2016 15:51:33.9310 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR08MB0363 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Comments style fixes. Signed-off-by: Andrey Ryabinin Cc: Alexander Potapenko --- lib/stackdepot.c | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/lib/stackdepot.c b/lib/stackdepot.c index 2a3f748..654c9d8 100644 --- a/lib/stackdepot.c +++ b/lib/stackdepot.c @@ -81,7 +81,8 @@ static bool init_stack_slab(void **prealloc) { if (!*prealloc) return false; - /* This smp_load_acquire() pairs with smp_store_release() to + /* + * This smp_load_acquire() pairs with smp_store_release() to * |next_slab_inited| below and in depot_alloc_stack(). */ if (smp_load_acquire(&next_slab_inited)) @@ -90,7 +91,8 @@ static bool init_stack_slab(void **prealloc) stack_slabs[depot_index] = *prealloc; } else { stack_slabs[depot_index + 1] = *prealloc; - /* This smp_store_release pairs with smp_load_acquire() from + /* + * This smp_store_release pairs with smp_load_acquire() from * |next_slab_inited| above and in depot_save_stack(). */ smp_store_release(&next_slab_inited, 1); @@ -116,7 +118,8 @@ static struct stack_record *depot_alloc_stack(unsigned long *entries, int size, } depot_index++; depot_offset = 0; - /* smp_store_release() here pairs with smp_load_acquire() from + /* + * smp_store_release() here pairs with smp_load_acquire() from * |next_slab_inited| in depot_save_stack() and * init_stack_slab(). */ @@ -186,7 +189,7 @@ void depot_fetch_stack(depot_stack_handle_t handle, struct stack_trace *trace) trace->skip = 0; } -/* +/** * depot_save_stack - save stack in a stack depot. * @trace - the stacktrace to save. * @alloc_flags - flags for allocating additional memory if required. @@ -213,8 +216,8 @@ depot_stack_handle_t depot_save_stack(struct stack_trace *trace, bucket = &stack_table[hash & STACK_HASH_MASK]; - /* Fast path: look the stack trace up without locking. - * + /* + * Fast path: look the stack trace up without locking. * The smp_load_acquire() here pairs with smp_store_release() to * |bucket| below. */ @@ -223,7 +226,8 @@ depot_stack_handle_t depot_save_stack(struct stack_trace *trace, if (found) goto exit; - /* Check if the current or the next stack slab need to be initialized. + /* + * Check if the current or the next stack slab need to be initialized. * If so, allocate the memory - we won't be able to do that under the * lock. * @@ -231,7 +235,8 @@ depot_stack_handle_t depot_save_stack(struct stack_trace *trace, * |next_slab_inited| in depot_alloc_stack() and init_stack_slab(). */ if (unlikely(!smp_load_acquire(&next_slab_inited))) { - /* Zero out zone modifiers, as we don't have specific zone + /* + * Zero out zone modifiers, as we don't have specific zone * requirements. Keep the flags related to allocation in atomic * contexts and I/O. */ @@ -251,7 +256,8 @@ depot_stack_handle_t depot_save_stack(struct stack_trace *trace, hash, &prealloc, alloc_flags); if (new) { new->next = *bucket; - /* This smp_store_release() pairs with + /* + * This smp_store_release() pairs with * smp_load_acquire() from |bucket| above. */ smp_store_release(bucket, new); -- 2.7.3