Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753507AbcKHPV5 (ORCPT ); Tue, 8 Nov 2016 10:21:57 -0500 Received: from mail-eopbgr00106.outbound.protection.outlook.com ([40.107.0.106]:23456 "EHLO EUR02-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751786AbcKHPVx (ORCPT ); Tue, 8 Nov 2016 10:21:53 -0500 X-Greylist: delayed 18769 seconds by postgrey-1.27 at vger.kernel.org; Tue, 08 Nov 2016 10:21:50 EST Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=aryabinin@virtuozzo.com; From: Andrey Ryabinin To: Christoph Hellwig CC: Andrew Morton , , , , "Andrey Ryabinin" , Andy Lutomirski , "Joel Fernandes" , Jisheng Zhang , "Chris Wilson" , John Dias , "Thomas Gleixner" , Ingo Molnar , "H. Peter Anvin" , Subject: [PATCH 2/3] kernel/fork: use vfree_atomic() to free thread stack Date: Tue, 8 Nov 2016 18:05:44 +0300 Message-ID: <1478617545-8443-2-git-send-email-aryabinin@virtuozzo.com> X-Mailer: git-send-email 2.7.3 In-Reply-To: <1478617545-8443-1-git-send-email-aryabinin@virtuozzo.com> References: <20161107150947.GA11279@lst.de> <1478617545-8443-1-git-send-email-aryabinin@virtuozzo.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [195.214.232.10] X-ClientProxiedBy: VI1PR0501CA0007.eurprd05.prod.outlook.com (10.172.9.145) To VI1PR0801MB2062.eurprd08.prod.outlook.com (10.173.74.147) X-MS-Office365-Filtering-Correlation-Id: 90ed7b29-6dea-478f-8f87-08d407e8b97c X-Microsoft-Exchange-Diagnostics: 1;VI1PR0801MB2062;2:4COuCZ5EW5QwqrCj9+O1Jqj+WxyGcdfYKY6t6ljf+eCcK6V6vQD4iws+bqgPkLR0SPy+oajpt0K7GmVVuQMayckfcgWxFj2fcaDlZABL/UXURNEYnM3eY+HBt7sYJw1iVtXZru1tTJ6s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PkG+3GskM55m110irBwLdd8kdvM4mT5ZGD0YQbMQs4NYP6a3AFKsbU6g2kT3IOJSYHtiPbSHNaX3YkYCbm2xqoqzP/FY4xPL+EcObK1FqqNb87cr2jFKg1jNpVcIWQlU517eh5mFQU/nOap3nih8gACW5+SJ/ifAQXMmdeD2kmSJne6E4opAxOcoiaJHV7zUlmnODbQdEMCQQ9ZrzNJ8twklfN9hV78mgVZx X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(211936372134217); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040176)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6043046)(6042046);SRVR:VI1PR0801MB2062;BCL:0;PCL:0;RULEID:;SRVR:VI1PR0801MB2062; X-Microsoft-Exchange-Diagnostics: 1;VI1PR0801MB2062;4:4j1N+B61hBBU2cPwCFdmcLhW89nQb2m2VRhrxMBi451KpmH55xxJqdFHJEPjU2/lCMVR8MM6GbFWMT4pROodj62CppEJY1w1KSwjWTJD6sh8KNKqhyeCNrAGLPsyy5besbFmfI/hObiQ5OBsSzsJljYcc2iCnmNdsAxmeuA7+dFk7bgoV4C8Ttc2ZyCs8XpngeWrUW2BcIoDvap3FS/cuk3uYCtLQOtgc6AKqvbe9wVeC+6vyzXCS2TjME2PqMLDCGuy1NYi4DZ5uDCFGG/OfxXWzMJSoP1nw3sAO29uxNt3tlRKsc/uksPlzlLBqawhxy1C0gsVQdinn0mioW2B1y4O7Z6yVBLE5LIDWPYj9LQo0NP5lzdsRrCANKVvDsmaim0Qr5+fqijY9nPyl+o+VHvuVeovV2ovyjyt5AONHcnBJRKpFJDYKD17E6du0Iiu9WfdEuqg+tz9nc1kz6ygcEfB0jiFx9i5EzoWyv9s4G8= X-Forefront-PRVS: 01208B1E18 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(4630300001)(6009001)(6069001)(7916002)(199003)(189002)(3846002)(189998001)(50226002)(2906002)(110136003)(47776003)(66066001)(6916009)(4326007)(5660300001)(7846002)(69596002)(101416001)(36756003)(6666003)(86362001)(2950100002)(68736007)(7736002)(81166006)(50466002)(77096005)(81156014)(33646002)(5003940100001)(8676002)(48376002)(92566002)(7416002)(105586002)(53416004)(586003)(106356001)(6116002)(50986999)(229853001)(76506005)(97736004)(76176999)(305945005)(42186005);DIR:OUT;SFP:1102;SCL:1;SRVR:VI1PR0801MB2062;H:localhost.sw.ru;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;VI1PR0801MB2062;23:EZmYYL7IzGRW+4iUqflU43jxWPtuzbVlEaEKzdJ?= =?us-ascii?Q?3f44aH3EG+lXJ/BFG3JV9FyLuxddlwy/jvMrM1SF9CgmF/5EzO+W/9Trt6oO?= =?us-ascii?Q?0phzN7/wJBI6cBOdCIMBQvW9tb/veQ11qmnVT6Y/XcF15QBxPn7TIe1g0ask?= =?us-ascii?Q?XTpRBrVzifDK+5f0MeXtlRtXxUMCnbyyFRc/U9HvJLoWL8BgNd10J6FCefmi?= =?us-ascii?Q?jtYtMegdBshSQiHFTgb7QGeW1dvNjHjjzJ2DTJysir4ivKcAzog+RdHyi1G/?= =?us-ascii?Q?2XjMjxQ9IybMlRzId5GDpaQaEvr67u5GZJFscbCc3hK+8A0UYeE1idzUPT7L?= =?us-ascii?Q?MjwetoH1uivsmGzJPFUYErnSTz4iQd4dsahvbgfmMmJTBuXWAo0ZpJIu9F7L?= =?us-ascii?Q?QuPh0BYdQPyLMzpEQa9pEHsk4MtZmeGzbYChXOlboXOpyzlHE+COMMCnjQV4?= =?us-ascii?Q?55hnWToidXHlTM/G2UGFwNIABwGWCuRcN2H1Cj1ER6LH6xx+8eZrJXHc/Yoh?= =?us-ascii?Q?xAFlmGdx0sAQ5T+MLziOmoi5UHFVOX+nl+rrtLBvEkcg37Vel72GW3A9oDmH?= =?us-ascii?Q?hNOwNYHNztMzdszZGj6FkeYT2vGC62Yop56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UVw==;5:o2KKFBbRcedZPM2C7DkNOePXUC1Kn4Dr+/EMf3FWKdyP31HNVt1CPdR6wQ/yajnhNlx1MovdH/GYjtMfEZhn8pjvOPqZoT4sEtWDetDlUMBLzPMevQsz162ub4PtO+Olq04bl1GgIigvhV3EwAbxVw==;24:U1U49YW71BybPzs3u+WuyFWoKQkCfNXiWtbEvMyxoOphI+/EXYwRCOOu0UPKv7ZGNB09ZF2SyHATNsD2frextSnKBTI+4a+M21XWs9BONEo= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;VI1PR0801MB2062;7:pOC1fCekEiFYguKUaC153fCrtCA4AVsNP0ly0uQ+DenPxuLRfT5Me+iXTvZimX675cZy782hKFrX9zhHVEICgFgAvqHzZULBJkLFy/UtwQ+97grKPgBE9bx3c2MR6i/uyANHvGvw9rgcALprXkHyGTYjN0Hhf5rOUd3ADCNyfJ3MhALnj+pUV6Q3ejt0cFYsOuhC+W9x53dd6CMDLrgqxW6MiJxzLegRxIR45A2YzCodn6c17AFmS3F7XrA7yto1SFGml/oLHiGnLxZCQGGbyhIHDIGjwFKmvi4vlKSHr6w5jjf0sJWV+2vc0DcbD21tVCJv591srjiYOx3IEo3haO4WkBt6gVj/MvF+TVYiCGo=;20:4kozpDFsFPCjXYkI/mq7pXr8KUD+miqHqVpaIWSsZkDj1quxor8xzArIYtYKByJgM/gmCtIFXSGCYqTRtBnR9t1LQgknQ5o1nYgoS2VMxnJJAcyOdfElH8xRVwQjF4nphnuO7eWQcBp7Th/ol4rA8XDIoZjJY1rLeXf57ANC4B8= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Nov 2016 15:05:48.0708 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0801MB2062 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 931 Lines: 33 vfree() is going to use sleeping lock. Thread stack freed in atomic context, therefore we must use vfree_atomic() here. Signed-off-by: Andrey Ryabinin Cc: Andy Lutomirski Cc: Joel Fernandes Cc: Christoph Hellwig Cc: Jisheng Zhang Cc: Chris Wilson Cc: John Dias Cc: Thomas Gleixner Cc: Ingo Molnar Cc: "H. Peter Anvin" Cc: x86@kernel.org --- kernel/fork.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/fork.c b/kernel/fork.c index fd85c68..417e94f 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -229,7 +229,7 @@ static inline void free_thread_stack(struct task_struct *tsk) } local_irq_restore(flags); - vfree(tsk->stack); + vfree_atomic(tsk->stack); return; } #endif -- 2.7.3