From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756279AbdIHOnV (ORCPT ); Fri, 8 Sep 2017 10:43:21 -0400 Received: from mail.free-electrons.com ([62.4.15.54]:52437 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755919AbdIHOnS (ORCPT ); Fri, 8 Sep 2017 10:43:18 -0400 Date: Fri, 8 Sep 2017 16:43:07 +0200 From: Maxime Ripard To: Peter Zijlstra Cc: Ingo Molnar , linux-kernel@vger.kernel.org, Thomas Petazzoni , Quentin Schulz , Mylene Josserand Subject: Re: mutex_lock issues during poweroff Message-ID: <20170908144307.vqb3tn5crs4ddqwg@flea.lan> References: <20170907121619.uj245cykaxmhsuve@flea.lan> <20170907124033.bmtsam7nizs7gnvv@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="36nvumhictfxecrb" Content-Disposition: inline In-Reply-To: <20170907124033.bmtsam7nizs7gnvv@hirez.programming.kicks-ass.net> User-Agent: NeoMutt/20170714 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --36nvumhictfxecrb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Peter, Thanks for your answer. On Thu, Sep 07, 2017 at 02:40:33PM +0200, Peter Zijlstra wrote: > On Thu, Sep 07, 2017 at 02:16:19PM +0200, Maxime Ripard wrote: > > One thing worth noting is that we couldn't reproduce the issue with a > > 4.13. We can't bisect really easily due to the amount of patches that > > we still have on 4.9 and have all been merged since, but it seems like > > the bug was fixed (either on purpose or as a side effect), and was > > never sent to stable. Looking at the history of kernel/locking/mutex.c > > during that window didn't really show anything obvious though. > >=20 > > If you have any ideas or spot something very wrong, I'd be happy to > > hear about. Thanks! >=20 > Well, we did a _complete_ rewrite of the mutex primitive in v4.10-rc1. Ok. What commit happened to be the rewrite? 9d659ae14b54 ("locking/mutex: Add lock handoff to avoid starvation") ? We backported this one and 3ca0ff571b09 ("locking/mutex: Rework mutex::owner"), and still can reproduce the issue. Is there any other? > Part of the reason for that rewrite was fixing a starvation case, but > for that you'd need to actually have contending usage, which you claim > not to have. Yeah, we're close to the opposite case :) > Aside from that I really can't remember any specific issues with the old > code (4.9 is such a long time ago). You could try to disable the > optimistic spinning code, see if that helps. >=20 > You did also say you were running on an ARM64, there were a few memory > ordering fixes like for example commit: >=20 > 50972fe78f24 ("locking/osq_lock: Fix osq_lock queue corruption") We're running on ARM, not ARM64 (they still are separate architectures under arch/, unlike x86), but I'll look into them too. Thanks! Maxime --=20 Maxime Ripard, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com --36nvumhictfxecrb Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIcBAEBAgAGBQJZsqx6AAoJEBx+YmzsjxAgvsEP/0dNNgPtEebn+2XdEihcvA8q IMZRBhtuHPhdDwr7blt3NCN91KbqBWD0uZL7Grc5Hg8VbZ7S9B7jrgqnw9qOM3Uo 3Zdudb8K4MZ1wrO9OXh/CbqSQoPf9mSmEPZJSU55hHKgPvRN9lLp3hZ+c8iPnkro ak3A169bDiY8deir656AFYurHYZtuBwfURGFTF2szZ5pEQrb6bmfHZcku5e3d1ey 7CTWxru6BxDFR8qHBTVseAaiTzgAqBowoNdVA1L9rVlHvOLOFvwf256Or1wZk35+ /8cMFow9CtISMj1QXxrafsahAuKIrD+giTIF7Ix3MEbueSyJIzDyx9hwT5PaD7JZ bHtLvKcK4vU9xJBkEGy4sdBTnEapS3X5Fnn3D2eOQvTnB+lyCv0ujS3PlCZS3kOW JYzgYgibk0N09EP9+WmdalKzbPehnm/W2Qu1l9+akuQljAnLkMRf/wx11BUtJaUz H7k0pfzATtZcaV5b8NI35OVMt4WPX+8H2UGusEI9JgQtZ4tiqnTogHv7gK4SsfrU DVZFdbyZujItjpWmpZ0ndH+Djuz7oONVEL8U7Irx7SuLzVASV2S0XKmLD3RXTXj9 DH+aiOF643/5tTMFCBmh15VcSMJ1G4QfLMMq237ttbcXtIAx3qb2yMsluG5StKUI fD/d8W4gF4dEWi078QJM =NRQ5 -----END PGP SIGNATURE----- --36nvumhictfxecrb--