From patchwork Fri Sep 30 08:50:34 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Ryabinin X-Patchwork-Id: 9358017 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 71ACA60757 for ; Fri, 30 Sep 2016 11:24:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5DE1529FBC for ; Fri, 30 Sep 2016 11:24:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4DEED29FBF; Fri, 30 Sep 2016 11:24:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0A17D29FBC for ; Fri, 30 Sep 2016 11:24:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752396AbcI3LYW (ORCPT ); Fri, 30 Sep 2016 07:24:22 -0400 Received: from mail-db5eur01on0058.outbound.protection.outlook.com ([104.47.2.58]:56761 "EHLO EUR01-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751099AbcI3LYU (ORCPT ); Fri, 30 Sep 2016 07:24:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=m1DFOhcRIUTXJt7Rus2/915t4IgqvXlXTRKecR7nEVo=; b=iAvUNkidxBUXGHBqc+TM18ntAvwZ7syHJdL/NyfEP6CMeILHhfKT2rMBfuj5UbuOpmLlUWhMFhJ+pMSJCacvMGHHuASf4tjJZC9xBnRqgGD6iO1bP4vR/2WfAw+RlpeaA3IgGXEx6zfYbUw4EcWYug/sznYwiDi0bA/mz4wNSnM= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=aryabinin@virtuozzo.com; Received: from localhost.sw.ru (195.214.232.10) by AM5PR0802MB2547.eurprd08.prod.outlook.com (10.175.45.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.649.16; Fri, 30 Sep 2016 08:50:53 +0000 From: Andrey Ryabinin To: Alexander Viro , Tejun Heo , "Rafael J. Wysocki" , Pavel Machek , "Oleg Nesterov" CC: , , , Andrey Ryabinin , Subject: [PATCH] coredump: fix unfreezable coredumping task Date: Fri, 30 Sep 2016 11:50:34 +0300 Message-ID: <1475225434-3753-1-git-send-email-aryabinin@virtuozzo.com> X-Mailer: git-send-email 2.7.3 MIME-Version: 1.0 X-Originating-IP: [195.214.232.10] X-ClientProxiedBy: AM5PR0501CA0009.eurprd05.prod.outlook.com (10.164.187.19) To AM5PR0802MB2547.eurprd08.prod.outlook.com (10.175.45.23) X-MS-Office365-Filtering-Correlation-Id: 2f3b308b-1894-48cc-9028-08d3e90ee360 X-Microsoft-Exchange-Diagnostics: 1; AM5PR0802MB2547; 2:Ez8ZBFyjpiluFJ1pil7VqUE4811rl9h2muFE7PXj3Y1BVQ11V690L5WMwKIuXpVpq5YUtRypwAVdz/a9e4To+TG/9Fbo/AbfSl3zNO9yBIy4EyWxSw8Ycp08LaoOwgOU+SCYcL5SfE8AkUs1EXbcFRvajos48LqOCicKo4+rNKEjIYlnKJpp2SFsvq5ui11cWZbEqufP3VTG75Ru+pr0Mg==; 3:VPXKGqeXBbqlpeYGRPrxzPhbPfrBfUy9NDXpMb1f1SfBZES1sGFrISNxTkOTKy0fmlKVxwKQYa0yNb3nHSBTJ/RYCmJlnS6+pLVy6ljSl1h5mBQ1vKZgvRCwCV+dYpfwAj0ty7RtONn4ajYL4uMRvg== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:AM5PR0802MB2547; X-Microsoft-Exchange-Diagnostics: 1; AM5PR0802MB2547; 25:6ImXIv1J3IQh/PFRic2qsORWlbDPEYIRx+J/WZ9xmZECuc9SOg23gBi6U8oujtYbrRjg2ClVmAmegouKGgMtEKk1dPE3vDQTaPY4Qyakalsx76L0Aa+FrbXQIHRrhLd7q9IE+WIJ6F7Cw034TzU8W19Pf6mvqRz0FRbjlHe2haw7fhKxzrEyEFhd75qHlC7O6iD4VUmWx9b99oNUwryGFxP7WI4s/Wro75065Pm9srsht5tU2OmIBC2sX21ZD5EkF/IH7nEHj/+woOcyzGeL8LpkbVwSVn0DbgE6oMXjxXZE/+JlLduYm5jT2g2iCzs7EH1qDZD11r7lodQ30I+9GxNu1wGlCEmGX7SnOL+yx4sC8w9kuNN5EGW3dTeA7h/tmZ2KdwI4ruDv7c0U2/TgWGKW9yj43vU6cGWTJZIqFgv4pq/aZ1DbNEjqKboToZZTxFg4EEJLSrEXBF+LAsYcWtDUtU99D1GuxbA16g/FpT05vJJ9O6RzsdOdFw+wWZHgPyQoDSNQOL9e2qwvaW6Z17zdywAjz+x50HxXCmbo4wtmFSc2zm1ZL/41gouWsqx7gcUL7/wJ6zn1P0z6YwNkdc6+WVLcr+XWS7ZAkHksS2Z/mwwc6TPt8yo9w10dbDkxEOYs6dyRrYHijRlQYbl6djTjmrzCmc0hNiVK47bVQUyDP1IQTJXH3KgW39MY3nia1BZUZwpDLhHXSsg2n0uFLgrebERgxkN0TSuxzMszwhOocrnPS8l243hISbM8NpD0vByb1b4SLZibOspIKC3tmA== X-Microsoft-Exchange-Diagnostics: 1; AM5PR0802MB2547; 31:Y0whGC6qsSomBjuHcF00vwFyRm/QHiGdBTcFMcCnu/PSTrlCas9kogD9fAizuIhGxVVH3chdNGQc4lDq9bJJnUY1v1hCSnI91nokfqaevd5F/6XRiamQfopjo2b0Ngl/EqQr6MfH1ErA2JmjkHQHKmRL08dV+pUgF//PwWLG/SREqMRGtzNXFURjE8GqLSuK/eFZYGtYMXe2X3Tn4zjVGAzma8npBOEQH4M24F2zrYJ5FN83hk9TY2MPiL5TfAmU; 4:iQt9Zn6P0FVnRkYbwH1WevD29YllqqBev+k6yDpCvbBQha5+8DQjsBR/m+IkGTH0BSl82kr/KTUi3YjCCvjzCiWK+pQK7zD+jNllnAVHe2fTNCXfRf5fshJyVtyEhObvcR47DlrqMdR2AV88vUMyozkzzwym24fjBWq3IuixwCghq+o4HFIjdtgVYKOFbSgawegrdd0tTLwKAJ6WcJ8rZycYTmdIkHPD5UlTC3DGhkbGTk7JczEcBsAc2jYkJYVMxAEwoDTlmhnCccY334TntKW4PXneikPkyWHZDm9mUQ8oQHQ5w92quHzs5hxWNdyIV9qVjrA7dEt7fTgX3jCVOBJYSgewQyFdWCeGowb4aWoEaWHDCWGQ8l+sxpy11Ae8/V/PU9dXND6BBGrTWHQ1oda0hXdqRpM1b5GTd+tZ4D5edFynljkKGL0npwjMhYXf7eMrjctiqaSXt0ndu/o/uvoPGo7kA1GrQH8jmygFCsE= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(9452136761055); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6043046)(6042046); SRVR:AM5PR0802MB2547; BCL:0; PCL:0; RULEID:; SRVR:AM5PR0802MB2547; X-Forefront-PRVS: 008184426E X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009001)(6069001)(6009001)(428001)(199002)(189002)(20776003)(69226001)(63696002)(47776003)(74876001)(62966002)(74706001)(36756003)(77096001)(76506004)(77156001)(76786001)(76796001)(81542001)(42186004)(93136001)(76176001)(92566001)(46102001)(64706001)(81342001)(92726001)(48376002)(77982001)(59766001)(56816005)(33646001)(80022001)(66066001)(76482001)(90146001)(89996001)(65816001)(53416003)(81156002)(87976001)(56776001)(88136002)(54316002)(74366001)(44376005)(87286001)(87266001)(50226001)(4396001)(47976001)(50986001)(95666003)(49866001)(47736001)(51856001)(50466002)(85306002)(79102001)(85852003)(83072002)(21056001)(97336001)(94946001)(93516002)(95416001)(94316002)(86362001)(97186001)(80976001)(93916002)(81686001)(83322001)(19580405001)(81816001)(69596002)(31966008)(74662001)(19580395003)(53806001)(74502001)(47446002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM5PR0802MB2547; H:localhost.sw.ru; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: virtuozzo.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM5PR0802MB2547; 23:DpZE36/ltpZaTIMcfCLmGFeS/m1n+U9ta8ES3Jr?= =?us-ascii?Q?wMM+k463DNjw+3jUhshZ+bQMxP7gGmcCgA+3G6119kOmTBgmqdgJ8OOiqf6k?= =?us-ascii?Q?kvZ1zZwdf7brtq84gzXKghLfzKIaAoM3UEiwplMujx6EEhsXRxGZpTAXeRvr?= =?us-ascii?Q?2vAM4jKbmw12Gqglm05oIQexresiZvNGtn+T1yqiwP8SxIptc0FJyoMmAhgQ?= =?us-ascii?Q?9l94L4dixavLbeLqFmFMxoNInDtxjZ4VcENQS+eIDNinwhrz23b3SNhnDKhK?= =?us-ascii?Q?MOpzClqkw6l+/19v52hfv935pbF4OAVaSFYoVYQL0X/IalWT2DKzJGX9DqWf?= =?us-ascii?Q?bcUoam/Pb6KFucQGWUjz/XmBWK/TvXjObv3/PZpshQBkBToEys2aJoqguLML?= =?us-ascii?Q?xEemTk6H9Ki8hvmWGyYjxlyQ+8q2QLD5BXZSeKyR/RLnCez57ftkCHV1s1yK?= =?us-ascii?Q?oHA4jQQ1p6To/DNpGxYUNSf4T4aZ6ipuk8ZElfOF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QbqByZed8+WgB3FJ8wihfoCAImEZYWpwYhHrgZBszzE4beKOo81BJXnUWkcKtCDG0E4lP1T6n6wj2KWFPL4MmMd31mXlwTQp2QVb4WMJGdXX6hkZFOqDNoB0WFmZC3cUWc4z/0YkUXc/pjPG3yLcG9UFUOKgejJOY=; 24:r8t/XowOJrz7O6d60INxhllDGQFsQtnO+P2y3V+VQcxcpAxgbSUFaz/V52P4HL4iQ/G035bQWCEXFhJwdwT20+MXuumEG504sTMYHCPZ9VA= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; AM5PR0802MB2547; 7:HAnkSELlxSCLa/ZLL96M+x1hs7VEVxBsEUYGEeepJ5q3gOyNxXpk9ysofQ/RNDc2ObSidgPFtEZqO6iHYqfO9Ku2QTHWIxa1OmeJIkAZPGXu6RbfOAmZRxT3ijiuH7kwcclQjtolzjm97ZF+10jdhKrT0Z2UtkQss6+fTF2a2VcPmCEE8/Sa6fQBJaAcTmm9kN4bFCDhdJE5c21eFkFT0sOAuljlf+5Dd2ym5981HpTzPakprbU2z0Ce2WNbhpHZ8jgTcsNXHdYwgAkMUzXjdHb4E2CLiRzYoMyXGx0HF7bcEgzekgHTwQuMdJyCvwEU+1+qVfqXBF21yNZQorr+CA==; 20:P9r5YUJKMHuzADsULqtzuSDm0aFDiSQn5T3M5UKMfJ+ShnH2ga7ZqmoM8OaK4HMI6a7ctJ8X2jf7J6A5KXOsHHGpSTIfwzyBAFcCr46rlevcgBcn5tK4xFR4CxtzRmaU5parrMon+Jcv6ih78UGsGOj7P21R2uQmYzxsCtGfFLs= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Sep 2016 08:50:53.7127 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0802MB2547 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP It could be not possible to freeze coredumping task when it waits for 'core_state->startup' completion, because threads are frozen in get_signal() before they got a chance to complete 'core_state->startup'. Use freezer_do_not_count() to tell freezer to ignore coredumping task while it waits for core_state->startup completion. Signed-off-by: Andrey Ryabinin Cc: stable@vger.kernel.org Acked-by: Oleg Nesterov Acked-by: Pavel Machek --- fs/coredump.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/coredump.c b/fs/coredump.c index 281b768..eb9c92c 100644 --- a/fs/coredump.c +++ b/fs/coredump.c @@ -1,6 +1,7 @@ #include #include #include +#include #include #include #include @@ -423,7 +424,9 @@ static int coredump_wait(int exit_code, struct core_state *core_state) if (core_waiters > 0) { struct core_thread *ptr; + freezer_do_not_count(); wait_for_completion(&core_state->startup); + freezer_count(); /* * Wait for all the threads to become inactive, so that * all the thread context (extended register state, like