From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 39A10C433EF for ; Tue, 22 Mar 2022 20:58:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230173AbiCVVAN (ORCPT ); Tue, 22 Mar 2022 17:00:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35032 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230023AbiCVVAJ (ORCPT ); Tue, 22 Mar 2022 17:00:09 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8FA6A14017 for ; Tue, 22 Mar 2022 13:58:41 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id B4D846171D for ; Tue, 22 Mar 2022 20:58:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 019BBC340EC; Tue, 22 Mar 2022 20:58:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1647982720; bh=qneKTjCnzz1tSRczDENyPpegPElP0m0jzzOPobXNPLk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Ht4dYd/bNEB12UbTCLdQOiYj35b9WG6DBUguqxmVkhLeU5fCqJUa8ZLhRZbqmPnKa leOOQPPl9CIm2JlCWfDym3kx99dyQ8JyM0HmSxS3JWmsisL0aJhsL9wRjN6jnTRTTs Y16qQV8sHJCGnqSP9JDo//puaaVKuF/eQIQmIal2zlpphLTmsxqr78C43cE78uVYaz n0nPEsNfE/62DIrpwvnbCjB56Q9naia+8XdWszdQNMoWbkHchBr+qU1JJCgFL59abo 2NWqJgv2/GiP0Rk640D9z4gmlJYagwuoyR+ALI6j49boo9+u6aEzvSkVvS+saGcqHG I5sa/JchBKDtw== Date: Tue, 22 Mar 2022 13:58:38 -0700 From: Jaegeuk Kim To: Linus Torvalds Cc: Waiman Long , Tim Murray , Linux Kernel Mailing List , Linux F2FS Dev Mailing List Subject: Re: [GIT PULL] f2fs for 5.18 Message-ID: References: <51cded74-3135-eed8-06d3-0b2165e3b379@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Linus, On 03/22, Linus Torvalds wrote: > On Tue, Mar 22, 2022 at 10:37 AM Waiman Long wrote: > > > > AFAICS, the read-unfair rwsem code is created to resolve a potential > > lock starvation problem that they found on linux-5.10.y stable tree. I > > believe I have fixed that in the v5.11 kernel, see commit 2f06f702925 > > ("locking/rwsem: Prevent potential lock starvation"). > > Ahh. > > Adding Tim Murray to the cc, since he was the source of that odd > reader-unfair thing. > > I really *really* dislike people thinking they can do locking > primitives, because history has taught us that they are wrong. > > Even when people get the semantics and memory ordering right (which is > not always the case, but at least the f2fs code uses real lock > primitives - just oddly - and should thus be ok), it invariably tends > to be a sign of something else being very wrong. > > And I can easily believe that in this case it's due to a rmsem issue > that was already fixed long long ago as per Waiman. > > Can people please test with the actual modern rwsem code and with the > odd reader-unfair locks disabled? The pain point is 1) we don't have a specific test to reproduce the issue, but got some foundings from field only, 2) in order to test the patches, we need to merge the patches into Android kernel [1] through LTS, 3) but, LTS wants to see any test results [2]. [1] https://android-review.googlesource.com/q/topic:rwsem_unfair [2] https://lore.kernel.org/stable/988fd9b5-8e89-03ae-3858-85320382792e@redhat.com/ So, I thought applying it in f2fs could avoid kernel version issues without any risk of updating rwsem. Meanwhile, agreed that we should use the right APIs, I'm going to disable this f2fs change in the next device having newer kernel to see whether or not uptodate rwsem can really fix the issue. > > Linus