Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932119AbcKHPW5 (ORCPT ); Tue, 8 Nov 2016 10:22:57 -0500 Received: from mail-db5eur01on0114.outbound.protection.outlook.com ([104.47.2.114]:37792 "EHLO EUR01-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753159AbcKHPWx (ORCPT ); Tue, 8 Nov 2016 10:22:53 -0500 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 3/3] x86/ldt: use vfree_atomic() to free ldt entries Date: Tue, 8 Nov 2016 18:05:45 +0300 Message-ID: <1478617545-8443-3-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: 4a36dde5-97bf-4620-8e63-08d407e8ba57 X-Microsoft-Exchange-Diagnostics: 1;VI1PR0801MB2062;2:4lqhxTGvSVk2BgDXCEAclm4Dmc+ve+HDpx3wOjaE6c9K9c6dugl/gV2B6ck99mNM6riFc9e47v28wFHQ+uPLbVCV8UMavi15GyFuokItv47wsCqQsHnTXdN5eZU5iIfpui9LjL5n8oEGwM7wcs2rrwaBSVs35QY7KPdcF0JNpboJWkZGy9xozkR6Qh0P5KsTuQ8/Gs90IsS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Ws1hVTrmiHQyfWhPPngUCAQwOPgROpNzdVStN+MHGuPzmD80tEdvOIh9YTn4AWkHWxb/SwQytCQsIG4BBD+MugqTCeAYF7JIVtubWkyrls+MjFqecIyd7pum5+AmKGjrFe 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:oTHHGOc308zQp47qTq3sQqcEbwMY/5usUBqvUcvIBEXy+A1aisaGagTE9wm5N/uioWHU5JWwl2gYfV/sOap0VpKkdqfcNcoekluxiBHBcclieDStKQhi9AZ/KahU9LJfGwODwrvjcNUFqSss9fvVFbQccIRvrhwC6hqQgKn6u/+YG38HJNeA0tzZ66WYPmAQ6eU0vFr5FiahrbrjOhIgKxSmmrpy3n+TV7QTR9W1MtvrNVe1MUN8EZi5rHG2bru4EMx4x29rQ3Uo0BchROIC7MNdT7+QC3pDv6XJNXG3qyr/zWABe36RHtmm1VcumG5PecGm2ipzFn3Bho1tVyh5W8nM81xNYVkcJaUGXMx933PrOGsevkXFNSLkD6k5TMrAe/O/ecootpTk2qtLrJUhzo3ocA4eRnLsBW0ZTtYZYZZCatKS87b/KPHVk70+nmh9uy69D3W3rxio7gLqUevoczm7frfFIaaG9bIfltQwK24= 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:wfngsl7JjRWCotYBFPQw/LbmbNQbkmgYIUnJCiT?= =?us-ascii?Q?Ibt90orZpiJ7QMKikS3oHyfFh+8aYAbhbzukoATgNViBQ5Nf0XpWHqM2guVz?= =?us-ascii?Q?qeBt9Bd3ieZlf4F/r5rVMbUGS1WzpqN2DRXZFQXy+CXm00FJOeGVMvF8s/bU?= =?us-ascii?Q?P9A5fVsaMJJUZARJmv2W9WF6LGxsGekW+vDPvNOL97h4BGHPIBNLIbP/nKDj?= =?us-ascii?Q?mK0EqosRznkSsC/YuvncCJSdJEzxftGODP93nSb1bYH9+BC/7pENrBW23Mfv?= =?us-ascii?Q?FTZiIJxYyAtwY82d5yfG5J/nfXJv5r0KjE/e3IG10Fy74Vzpd8l+gcW8Z6wz?= =?us-ascii?Q?Mptxh795JwtNFtuE9Vx1su/naKMFz2gulWTHCTpvAxs21k6KfDqm7GKlI0BW?= =?us-ascii?Q?K94yBv1iP39X7rHR6PrCJuZIl/9YGxJzKClMoQBdqtwqe81abIzOKw2F5083?= =?us-ascii?Q?WtO79fYwAyXaLwMmKFxzgy1GeSdOK6uX1IZAnmzi/+z/+5uOwmlJ91cYCmyS?= =?us-ascii?Q?llEAsFjPQXPi9+Q5K84IZpfDPG7+8bsuGjja5Xr43BSZmwVdZoEtjLC2fotF?= =?us-ascii?Q?mhAoTrMNCfzCpjqt8RZc10uk0sM33Kp1I6lS04hWts76drYTL6m2mGhAcBet?= =?us-ascii?Q?p9coI5lzJHObaJzq/QRMsQ8MQ0n/iD4nR1ENIgtz/QMl6MBceY66vKUANmVm?= =?us-ascii?Q?NYWMn9XpZW/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MHD90z7rgGE/Q0x0NDREiAqJniMoNEpBkA==;24:TAAs94vvI3TOdycLaVAGWHB5O/3aOC+dP1hmbRsmAmev4FEc0iDF2jsUimGac+Sie+ivu8r5xfS+BJVdwp+wRyFEvKXwYm6y0wXyIZ1t6N8= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;VI1PR0801MB2062;7:YWvcOt7cmzjSdeqfIQYiD0XCVLqFmXdAF7KZB9SocUO07GYn9TZd5Q9KqWM3Kko7LVw7ARfWcNc+gDRNFEH9IzDEPBV9E9S1SvgYTRYz4sNuU7WGfgCfZRYZqwu1qNnps8ilHjWFmDse4HX5NMY9FgEBMvANZi0wHVHLr0O115NMUbeFcq5TMbTGr/lcgUIEwcSDumgX/LbcYorEAZqPo+nV8/wWrR7kYAM9K2QMVw5aTIX8BYWSoBMRiMEeZ+RUZXk+tuJGjMaTrar57OGw2z2bxyoAVF5BYufL+T3WT3nDe6vsXnBKQWRd3nZ0v6uKJPv5dXIP+3QVDcmV89lqtaX+vt7Fwh3/P/Kewa7wdDY=;20:zft7wciIKEInn+Maux6mnIOi7Ju0WlJpP0E2cWw5NRASBw1oScfeCsIGebUpPcAePoPpd/sKjAgrrNeGhF3FhXWvtsADNpsunImZruJI9B2H2AK3p1U0qI38GsNvbZ1ChVzNP6PnJl6eA8QJPEDtbQz2HYXeV+NXY8UnNIq+8Fo= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Nov 2016 15:05:49.5030 (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: 1219 Lines: 43 vfree() is going to use sleeping lock. free_ldt_struct() may be called with disabled preemption, therefore we must use vfree_atomic() here. E.g. call trace: vfree() free_ldt_struct() destroy_context_ldt() __mmdrop() finish_task_switch() schedule_tail() ret_from_fork() 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 --- arch/x86/kernel/ldt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/ldt.c b/arch/x86/kernel/ldt.c index 6707039..4d12cdf 100644 --- a/arch/x86/kernel/ldt.c +++ b/arch/x86/kernel/ldt.c @@ -93,7 +93,7 @@ static void free_ldt_struct(struct ldt_struct *ldt) paravirt_free_ldt(ldt->entries, ldt->size); if (ldt->size * LDT_ENTRY_SIZE > PAGE_SIZE) - vfree(ldt->entries); + vfree_atomic(ldt->entries); else free_page((unsigned long)ldt->entries); kfree(ldt); -- 2.7.3