Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp1621431iog; Thu, 16 Jun 2022 10:03:57 -0700 (PDT) X-Google-Smtp-Source: AGRyM1ufF5kMzb3N27Dtk2TuH54mCFLSccaEqJ0pWcMO2kf1d6QnUkJZBNBSqa9gtqfQfKevIVYE X-Received: by 2002:a17:90b:33cc:b0:1e8:70ea:140c with SMTP id lk12-20020a17090b33cc00b001e870ea140cmr16989182pjb.237.1655399037420; Thu, 16 Jun 2022 10:03:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655399037; cv=none; d=google.com; s=arc-20160816; b=Shn4lqnn9EUgegHGUyiYYUb4ARh4VqSqoVkIZLoq0uAx3FCprOvpxsF5cc/KVKoIBl B8QMdzQ2/VZA6iUDjuPRDEZj75zhifqbnHF+kl+uodlUJq5HedSX3WIgPRTvVc5SAWeG 3Blk8XQeDbwQByqzIsRmKBivF7TEn/AW+wS5CM87ottkUzQvHo26U5Qde1axwpZWQSSg ztPKRpm86CE9aKvXkXbEk3fDMoeFH4fpwDZQ1+e5QiyK59XmDyVGJP/21/gntK3gUjxu SmiAu2S4czDtas9mLmC2+MlYiiKzS06BI6F4b3Bn5dFTE8aJtbCtcqqUxwmE/vFoSXtG pF1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=tXl9ykhxuvt1NonatURdosz6fn5xpieEmXQk28FScFk=; b=CjPwDT/rvTD7VClNrsj7sUi0AWfMKC6fdfnHXez2mry1Ai6g0htV/cR6fdsyh7RdI/ h6Oa2tEUfxUDCtTansEyjItkTYtnQzqA1dcfyUUNgqNLPR5mTPtIEKRVs4+f8/e2Kz4N LJei/BNzHxEduFNrlK7HCVMusCGhpvZ85Byesz0QiWQ1n6CdvChI0pLGTYVZTaPON41e E45ebL/9rCLJdzyg6A/PrcsM54EJWKvZPOh3wuUJsQ63SPPOkri7au5de/v/bot6odBC f/4dz4K+JYVMJ8gl7YrY/PGeOx+aR1sj5r6fO00gPVA8c3f2ZVbPfl9LwNmDW7+DlF8O NDsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=RcWyAlCr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s6-20020a170902b18600b00169ff93b923si543233plr.48.2022.06.16.10.03.40; Thu, 16 Jun 2022 10:03:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=RcWyAlCr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345270AbiFPRC2 (ORCPT + 99 others); Thu, 16 Jun 2022 13:02:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39104 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345057AbiFPRC1 (ORCPT ); Thu, 16 Jun 2022 13:02:27 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 38F5F443C3 for ; Thu, 16 Jun 2022 10:02:25 -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 B39AC6194A for ; Thu, 16 Jun 2022 17:02:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E6488C34114; Thu, 16 Jun 2022 17:02:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1655398944; bh=XnVv4J01sdGBe11MNJIXMTTsXg4laIcwwL1T++aKoAY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=RcWyAlCr0j8hyWym7NRFXVgQcYDBVCnYdfXopAy+sBmRw59Ei3RFI86S6eWFdDkRw yOT53lW3zswSA6EgeLsI+M9SgidiiobkmfeZOTGQykdcqq5AfotbvsMRhxJl0W2WAL re7TJCh1n6zpyyoaDwTlno3Odx9bfybDVjTaBOnD79wgzONbGehld0Ekqp9uenrbot uDqE/JODSJK3lW7gZgdqMqzZUBUxswtX1s+G4XE65kvJhxp24jLjOJ32WTUDyMb7fh Gv/gFzgOEErxTi2NMfM6K8bao92r8awJaNRKVI5DfiUOA5/4OhD0S4SVvdTy9sAUws Sir100L21DLqg== Date: Thu, 16 Jun 2022 10:02:22 -0700 From: Jaegeuk Kim To: Pavel Machek Cc: Linus Torvalds , 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> <20220615201318.GA1194@bug> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220615201318.GA1194@bug> X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/15, Pavel Machek wrote: > Hi! > > > > > 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/ > > Wait, what? Normally, patches are tested before going to mainline, and especially > before being backported to stable. > > If you can't reproduce issue on mainline kernel, there's something very wrong > with trying to fix it on mainline kernel. You should not be merging untested fixes > so that they can make it into mainline and then into stable and then into android kernel > to be tested. What do you mean "untested fixes" here? As Tim mentioned [1], this F2FS patch resolved the issue in our Pixel devices. [1] https://lore.kernel.org/lkml/CAEe=Sxmcn5+YUXBQhxDpzZVJu_T6S6+EURDqrP9uUS-PHGyuSg@mail.gmail.com/ > > If there's no other way, you should be able to backport those patches to android kernel and > test them _before_ merging them. Android phones are rather cheap. Some should even run mainline > kernels -- see for example Oneplus 4T -- if you don't need all the features. IIUC, the point here was whether we need another generic rwsem API to address the issue or not. [1] said some rwsem fixes couldn't resolve our issue, and Waiman wanted to test another patch [2]. In order to avoid endless tests, I decided to get some results from Pixel using v5.15 (at least) by turning CONFIG_F2FS_UNFAIR_RWSEM off as of now. If we can see v5.15 works, I'm happy to revert the F2FS patch. Otherwise, we need it for our production. [2] https://lore.kernel.org/lkml/5acaaf61-5419-178d-c805-62f979697653@redhat.com/#t > > It looks hch was right NAKing the patches. > > Best regards, > > Pavel > -- > (english) http://www.livejournal.com/~pavelmachek > (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html