Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753617AbdCNRi0 (ORCPT ); Tue, 14 Mar 2017 13:38:26 -0400 Received: from esa2.hgst.iphmx.com ([68.232.143.124]:48026 "EHLO esa2.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753598AbdCNRiT (ORCPT ); Tue, 14 Mar 2017 13:38:19 -0400 X-IronPort-AV: E=Sophos;i="5.36,165,1486396800"; d="scan'208";a="99211597" Authentication-Results: spf=pass (sender IP is 74.221.232.54) smtp.mailfrom=sandisk.com; linutronix.de; dkim=none (message not signed) header.d=none;linutronix.de; dmarc=bestguesspass action=none header.from=sandisk.com; X-AuditID: ac1c2133-9afff7000000c960-57-58c82a7939f4 From: Bart Van Assche To: "bigeasy@linutronix.de" CC: "tglx@linutronix.de" , "torvalds@linux-foundation.org" , "linux-kernel@vger.kernel.org" , "mingo@kernel.org" , "akpm@linux-foundation.org" , "hpa@zytor.com" Subject: Re: [PATCH] cpu/hotplug: Serialize callback invocations proper Thread-Topic: [PATCH] cpu/hotplug: Serialize callback invocations proper Thread-Index: AQHSnOm5n98+t9sMrk6qODlEqvcm9A== Date: Tue, 14 Mar 2017 17:38:00 +0000 Message-ID: <1489513067.2676.9.camel@sandisk.com> References: <1488851515.6858.2.camel@sandisk.com> <20170314150645.g4tdyoszlcbajmna@linutronix.de> In-Reply-To: <20170314150645.g4tdyoszlcbajmna@linutronix.de> Accept-Language: en-US, nl-NL Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.28.1.254] Content-Type: text/plain; charset="iso-8859-1" Content-ID: <839034DB820EF64CB5843997AC69C952@sandisk.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrDIsWRmVeSWpSXmKPExsWyRobxn2611okIgzu7lCzmrF/DZjHt4iRm i2kbxS0u75rDZrH63ylGi82bpjJbPOp7y+7A7rFpVSebx7tz59g9Tsz4zeLxeZOcx4mWL6wB rFFcNimpOZllqUX6dglcGTtXrGAsaOKq+LPnPFsD43qOLkZODgkBE4md35pYuxi5OIQEljBJ nFoxjQkkISRwiVHifGMdiM0mYCQxe8IeFhBbRMBYYs+ueUwgDcwC25gkFk77xwaSEBZwl+g8 +pwRoshDYubZU+xdjBxAtp7E5w+CIGEWAVWJL8vamUFsXgFDia6XT6EWT2KUuPL9CliCU8BG Yv6Vm2DLGAVkJRZPbwE7iFlAXOLWk/lMEFcLSCzZc54ZwhaVePn4HyuErSDxeQXEPcxAe29M nQJlW0nc/rSDGcLWlli28DXUEYISJ2c+YZnAKDYLyYpZSNpnIWmfhaR9FpL2BYysqxjFihOT i3PTUwsMTfSKE/NSMouz9ZLzczcxguNU0XgH478N7ocYBTgYlXh4N3w6HiHEmlhWXJl7iFGC g1lJhPeD+okIId6UxMqq1KL8+KLSnNTiQ4zSHCxK4rwxs6dGCAmkJ5akZqemFqQWwWSZODil GhjtVufON1Fs64g7GL//hv68Q/l9iz2d4wKPzhfqMBUvvb5v5+dn529mbnr+m/PVz+OKyw2W 9n983jfx4pTp+7/4XT5/I311lG/V3m7u9Ikchqdvb/k4l2+zvKt5MMM27nt3uF5fl3q0uKR0 6oKJhe+i7GWjFP7f3rBo49PWoJnuL76s5wv5dTNqjhJLcUaioRZzUXEiAA8ZAUnPAgAA X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:74.221.232.54;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10019020)(6009001)(39840400002)(39860400002)(39850400002)(39450400003)(39410400002)(2980300002)(438002)(24454002)(199003)(377424004)(51914003)(189002)(52314003)(9170700003)(2900100001)(38730400002)(53936002)(305945005)(7736002)(5660300001)(229853002)(356003)(110136004)(54906002)(189998001)(8676002)(8746002)(6916009)(86362001)(2950100002)(1730700003)(8936002)(81166006)(47776003)(2906002)(2501003)(6116002)(102836003)(2270400002)(3846002)(36756003)(23756003)(50986999)(6246003)(76176999)(33646002)(54356999)(5640700003)(106466001)(106116001)(4326008)(103116003)(50466002)(2351001);DIR:OUT;SFP:1102;SCL:1;SRVR:CO1PR04MB524;H:sacsmgep14.sandisk.com;FPR:;SPF:Pass;MLV:sfv;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;CO1NAM04FT008;1:seVKfiJuR1Tk4mZbli9+uLcOoEhRdJa615nbrtHvDfFFntS/wr4xkt4nb9hG8oBVyUgIhGP/9qUKEM1ndiAsOJNrS2JkG0/gzsJP0wX3juMePWcHwdl9vh2DHzpcdFcbkQ0CU4eIb9jZE4+7ymJmzzLRwrVBH86z9J/iKfhNwNfBcOYG+TS82jTbQCA2o9RIz3k7YqCXbcNnejFvgVRRNd+Cgx3CuflRWlYcvlNgDRHyytDE5+b+BFG/1TfRZM3I0dfM/fWAPPJ7OYDe6nuV6HKqq3qQ0iT8RVX2mHkwYLiIlJtGpr9UwtBclKTar2jgGup3MuPVLX7S//B2BL8WFXZbv4ptibvU5ncMPktiU8qTDHvYcvb0w2vhMMEZzW1xeWQCJi0eq9B68vGvK+tiyPkdtsvOJeqO9MJxbAGbjlkuRbLytBcklObNvppWQUbVH1X1DwGyZS+ATLh4Np7Werrvv3L9yr+GqYiLki4jV4r3/BOfL2RE0OlwqPXhOpqdkHgnw4aescOm+Apa9LIpfg== X-MS-Office365-Filtering-Correlation-Id: 7851538f-4988-4d1f-3b2b-08d46b00de82 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(8251501002);SRVR:CO1PR04MB524; X-Microsoft-Exchange-Diagnostics: 1;CO1PR04MB524;3:un/rqsx7v3hA9oK8TQQ+ySGyxsHShayNCkabLOgPtISjf4Rv2hi2TbpXeya03u02uZVvVlYdfDD9ZpeftTwHLrKQuGLZ6o+YzTRfX+2R3LQNO//G9NPVYJNfAdeFRzpkhKTHP2oIaB8C1VH9HoymkxQ5VDwY8K3sGZrHgua24c4n2aLGPs7zR1aZ6E+CwWxR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I+MRIWIQM5+KZJNIHGIuOhhTGslR403/ncT3FUTEc7qGltqYs4xp5TZPctY3CgvlJiuhwqjeu9N2zuu20x5I/u/k2BAC5vLoT9faoZ+3gWTdL9nz0/6wWBEHaDqg+s063uVihhY1+Shk4WvWGrunxVdOoMO1r9pHkMYGj38pj9XkhkKmYbgFnMwLR5vGGT37CYSmUZkbo3ft4SZ6qya+ehkTQgj/5VF/SI/IqilY/1iiTTCvJq3c15DfRi2okX7NiggsySERkwnTytlmwaC5JPwFAaVgRFlnJP8VQEHpip4XEv5+cu/ZYagcYtlIsyRMBuYneS7sazAsVIlE+JROvNdS5RMwBUEWoKoiPXJGYHepmnn2X5uu22L9xv2+cW2LkcM65xSmWMrgcJkKO+5SUfgKsPh2fRk1b4JknpWR/3slsv1yJF5HT1btN21vBKVJMpCUhb6XYNn70M WDCIPOUTBOUND: EOP-TRUE X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(788757137089)(42932892334569); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(13024025)(13018025)(13023025)(13016025)(10201501046)(3002001)(6055026)(6041248)(20161123558025)(20161123564025)(20161123555025)(20161123562025)(20161123560025)(6072148);SRVR:CO1PR04MB524;BCL:0;PCL:0;RULEID:;SRVR:CO1PR04MB524; X-Microsoft-Exchange-Diagnostics: 1;CO1PR04MB524;4:w73GL5IpLKZVnYCS7JhrDVVbJ/Nm2b6BIS0YgCa48+pAX/u6yrG90gh7pRiQU2KdpUuRPSwhTKUCgWPlL9gYkIfaC6sN3gaaxI8vRjjVAijmAR7rgb+wH4HONmmD7tlkXvDL3ZA23cPyQHCojSMJvD57yiqP+/6J3S18pa+fZss4UPX4FTw9oC6FeIkiYICY1cYv+5lAOrORhgbZfprRzQgK/83RPFIhs+WwgGyQLy1mE7myDsl6YdlL3vxQchpV2UOK1pgxoCje+YDPU9qhxqL57Kpa3M3z85oVL+0eI58eKBhO448ZFjPwjMbK5YKjOMQd/cc3RTZkofZau0WKF6NpDjdbh2FbJcaMABf25hMNrvIKea9GRoBpBdrgeUW8m3Nj2zBQwzj2V55cJXl95pG4VHXaXNhOTqWgpAAPTEC2GU0ubzZvickE9E5JmjE/gnOSwAhUWxxrxAgaJt8Mq03CEzuyW19YCRbCvSATerd8jtjzOj7n3BXlkznoE7m9neNCTNo/FSJJkBJ1CbWqRc01WbfC8MJByPnj+eirK3dQvvbTyEkAe1NuDTfAJ+b+kR7wDB+kguouhHSnfN4G9H5HSqxEhulTYuvQjPDwjbaFZXlI6k3e5tCjLhqmFV8SU6ElSWxPzlZBNuXNQpNZim0caRXWBPenuQ2JbKYkqyCKCApyFqROR4+WS7D1tW/rs6A7yt490GWDnX0Fq+cBoCBMB1RHjXVnDUXJqoYbO74iPcnQXXfNEfwfEmJu2/eKeUfG1TfwZFvGJJMiFbhbcw== X-Forefront-PRVS: 02462830BE X-Microsoft-Exchange-Diagnostics: =?iso-8859-1?Q?1;CO1PR04MB524;23:SHEoiEKrBROwKo2PPPwRmA9/cscvnulB2ozCK4NI?= =?iso-8859-1?Q?EdVwq4vaeq7RfjR9pXUBwdRkc49wXF+L0uTMGuayt8YEKfpRN8vYyfXvxh?= =?iso-8859-1?Q?58MGidrDbLTncHZf95Pd94YyyHlbCaugQivQnm7AOtmahK42DrsfjYQcsc?= =?iso-8859-1?Q?Sn/xBAqux03OLG72GbRb9k3AeL2iSA4nEZCLJTfTnC+033TQP9g6P082IM?= =?iso-8859-1?Q?ehXQa7Pn8JulLel5vUg9HT5ddUOb6ikrhaBTnc7jFnPu1XfiOSazdoqK7c?= =?iso-8859-1?Q?szNQ7JutlHepJGqbeSKVA7RPZwXKpwtcxCP3wUGHgZC/BOuW4ocAV05Np3?= =?iso-8859-1?Q?ot9C5cKsetL/vVgDyEGZ/Mv8+Vze1W5JNs0HSu77Bnc5O3jMltJ3MwLYDY?= =?iso-8859-1?Q?oKV+MykrIRITCAjI93EiIXOYqRgiqDj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4k1KMLWBP7Ztssfz9uME5ajmcgrFzQFYBE+M8869dvH?= =?iso-8859-1?Q?5SpsIAcUOO58Y6+uPq/wCzBf6rYy?= X-Microsoft-Exchange-Diagnostics: 1;CO1PR04MB524;6:/cX+DfwWGHEiX91ScNuQqic3+IetMMelJ8Mo8gsT7528RVowEb7H2mNI6J1b1CK4xqnFeavnmtCYNtzygv7QYWMu0TjRfH7Fr4/cLkeDw6yRBnoTe0d5sKKLQI4i0jY/rrjyCtonK8TSOjxr6PsWDGkzhyqUFruiwP49+iD6F7K+LSUjt5FJnrrCVH5M8qfZAMWzHq4zuWCxQHEPe/862FdwroScynUNDGMrKYwwEek/v6BNOhIavw5YBxOTKICxQt903a/lvv56psPH+436JBzzDBF5h3On6N1Nd8e4nL4ouXvQNqr8q8pHm663047uhBGaKXcsgpiZsNAPGYDAJY5BgoZv9tKuY1Azr9w/k5XmMGHXQenGhVfIoD8SOE5gPdxsaaFxic2B258i86HOjDcF8HEK+lSrs/c+2Q5dnJ4=;5:tqTYcoj0TrfxXuknJXrJydjX5wpjyOuRF/YW2KR2/wBMq38U+1gRP7KIUNbecl3y6grpPFtDWf1qzLizHW0NBC3I5ux1DnXrrM6I/6Jw5ymfS/kmrh9flDH3LZE8GJLHGffv0C7TgPMHFRXqR+/HFw==;24:qpQQB+gcqM/ZqzfMMtOMkFuFJhbadgmUmA2KRge/ACMnQO2Guv2cs2JwZhrzqw8x/rCVvnws9p2DXagw4WJSWxucpbcjP3nrFGUCE1VC6JM= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;CO1PR04MB524;7:8oFhPkyKrtALdzqqRG316mKK5WLBuhu+bywFd6zd1LnGMMtk27fyOys8aExS5NzIVdRQlLOpWTBqBX3sAkDq87yZNkZMpxxKAuRVxG2INM9eOmarvGwKmRLy1Kq3TGFkFhwSIKApueNWWkjJ2VWiR132OqR+5HB/larNFfI5YBxfPeuRIIQiN0Q7hexCot8x82iKLeP4rkm+FC7nlpcuKePHVhhprmioQffvTEjXtAX85bHTyREevOM+f/Qd4hlLwqqpFcwnU4IcY1Iwg14MPHe7GyWXXf3nczJEJL8nQSlQjKRpFTDxO1ttFfcUwOKnZ+hcjLuR2Kz2zXIAbcbNAw==;20:POLy7Zq/NVLDQ+YaVhKYkZdYWEoMdTe4l+nHDFFEpRh1lG6nvISfE6QAxxu2lDUM9pORW3AV+V6VMty6+0jyEBHnrrytb/c9rHEJSY3LP6oug0aIHw53JV5Gp9A/n3kFiXV91PwaNT6AqVDdKAMGIjlb2kDvXZm3gyPV98BpyGQ= X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Mar 2017 17:38:03.8800 (UTC) X-MS-Exchange-CrossTenant-Id: b61c8803-16f3-4c35-9b17-6f65f441df86 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=b61c8803-16f3-4c35-9b17-6f65f441df86;Ip=[74.221.232.54];Helo=[sacsmgep14.sandisk.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR04MB524 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mail.home.local id v2EHcUW1024334 Content-Length: 1235 Lines: 26 On Tue, 2017-03-14 at 16:06 +0100, Sebastian Andrzej Siewior wrote: > The setup/remove_state/instance() functions in the hotplug core code are > serialized against concurrent CPU hotplug, but unfortunately not serialized > against themself. > > As a consequence a concurrent invocation of these function results in > corruption of the callback machinery because two instances try to invoke > callbacks on remote cpus at the same time. This results in missing callback > invocations and initiator threads waiting forever on the completion. > > The obvious solution to replace get_cpu_online() with cpu_hotplug_begin() > is not possible because at least one callsite calls into these functions > from a get_online_cpu() locked region. > > Extend the protection scope of the cpuhp_state_mutex from solely protecting > the state arrays to cover the callback invocation machinery as well. > > Reported-by: Bart Van Assche > Fixes: 5b7aa87e0482 ("cpu/hotplug: Implement setup/removal interface") > Signed-off-by: Sebastian Andrzej Siewior Tested-by: Bart Van Assche So this regression was introduced in kernel v4.6? Anyway, thanks for the patch! Bart.