Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp338337rwn; Thu, 8 Sep 2022 02:22:05 -0700 (PDT) X-Google-Smtp-Source: AA6agR5X5jjHgx9LlGBfrPNRGVsyowRbWC/r0MvAVb0nLYMgpOkAEltYLgMd/oJLChTvIvU+DC4f X-Received: by 2002:a63:2ace:0:b0:434:ebd5:e18e with SMTP id q197-20020a632ace000000b00434ebd5e18emr5743709pgq.79.1662628925535; Thu, 08 Sep 2022 02:22:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662628925; cv=none; d=google.com; s=arc-20160816; b=wyniSQ+FIXvlSDMeUbD/xjFQpmqYqKfoabXi9ezWySIjrjsOnUQg4/o+pDXmHeQTv4 NKxbjFNdVeqTzRzzAU4G57WTiWkZW4z53IDBDwZA95w/Z5uqbDhomfmtC0Bpd6CW/e6e y4WzNWj8JGIlNt6whzrPbOwfWoviUc+tx1QeKv/tZMiF0P9G9Bmh1ch3Ouj5i07Yf+bo C3oCscWOOIU6SHY0F5Qfm3VRvjmndnPqVeOYa+MHMPfg8nGE2NUaD0afZ+Rt7leOCBLN 8/QVeC69xE2Be521MTukU1gUe8gqUqYWSG4HPA+yM02WgYaX1t9dAb3EdaW66R9UOoYl 28kA== 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=hnBPIcuBbiTJ6T38MqUXTmFHiX7vavyzIU2NCuu61RU=; b=UxhN2drH9/6DPVXpU+SjDsvKyRb8KuiAYcNUnNw5Rjy32qwMESx83B3bT2Ac+6y/cY sCVzQnUZfqE6wD8ezRfuuT5QfShrP5rra7Qw/pq5n1YyBbbYl96PJRo/vSLc/mEatJfv jAvb+x/Kvp1MYTA1h6sxNxNKFdGu9MP06H4X7v9+b7XrZF6DVg2DvBS8J2nWpBx+MfRo ompAD0VD861/vPKItFXDeQPrzWN0f03r2WY4hMMvDGiJ3MT3QD0WCwKAtTLt9Fs4dnTr 5/EG/NARS6zVP3Oxs93ep/+yK7v9WURlnDxAKeWUltwFWbk/XEV1ihKnbBeT7kB/iQWL h25A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=IM2MUcye; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e7-20020aa78c47000000b005381feef4e7si18392441pfd.320.2022.09.08.02.21.53; Thu, 08 Sep 2022 02:22:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-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=@gmail.com header.s=20210112 header.b=IM2MUcye; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230163AbiIHJNj (ORCPT + 99 others); Thu, 8 Sep 2022 05:13:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52062 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229776AbiIHJNi (ORCPT ); Thu, 8 Sep 2022 05:13:38 -0400 Received: from mail-pf1-x436.google.com (mail-pf1-x436.google.com [IPv6:2607:f8b0:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BE100FF514 for ; Thu, 8 Sep 2022 02:13:37 -0700 (PDT) Received: by mail-pf1-x436.google.com with SMTP id c198so7420765pfc.13 for ; Thu, 08 Sep 2022 02:13:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date; bh=hnBPIcuBbiTJ6T38MqUXTmFHiX7vavyzIU2NCuu61RU=; b=IM2MUcyeIPudii/nEByJXHG7P/xBWWz321xVy4k7h+Gl7P6pQvjSSMP2dn2RDwgrCq kASfhgYNhsGX/WKfATRkEBOcDBWPBcewQYccZswx0dm2mkCOXn8MVUyK8EFgdiDV8Jql xhJCGiAVesroQhBQyUzPeKHs7iiy5Dugti7MHr27K6EwIWtN+GPq6hVqkcAI65vrLYki 69xOWkHEgQY2agsn/WCNQm69/rruS48zBJQtcQv39DNAF4YkMeCuvAJZJVA6SRiDVkLz HNWi1Wxpavu77E0e/8LLnophVd1SAB9trjDrur4ap+eakZd9HaXuQAGVw6h78zfQF3jS 93wQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date; bh=hnBPIcuBbiTJ6T38MqUXTmFHiX7vavyzIU2NCuu61RU=; b=rsFRO1Hw7UWz3YFqQcfW8qHz5bWmuKZq9hylIgVQ7birbB2jEsj6GSLtjjXsW/l9ij +svUchOUw1q63FJ90E9AlN+XvsWjmWXsyJnxyTCaHjXDZfiHRO8xUwSS0arUVRF4+7vn TSq7FFPAwey+WT4d5St8/UsB8IDtlKI9xxKVNfy86rfxbNdLewAEYWANUNOto77k4in5 at9YDDufRMuaxft1ZlhHagNJmZ/KChXLFuvY4d7OgfNTnexYGewXhZSL6w9/XSy68d2Z XeHuao8+eUCM6sqVIx7qQId+CredzvY0JdToBQFMgBq8AID9KSAvb8O0hVz2jQEGTqUC ZJjQ== X-Gm-Message-State: ACgBeo19Q7qsdiVEbPzZA1vb13kM9czm9K5CImrHOq+jkUTBXeFg0FGz 0yIplsUOz+wt0Msr3QRgtdg= X-Received: by 2002:a63:8a4a:0:b0:434:c99c:6fd4 with SMTP id y71-20020a638a4a000000b00434c99c6fd4mr6862822pgd.24.1662628417331; Thu, 08 Sep 2022 02:13:37 -0700 (PDT) Received: from localhost ([2406:7400:63:83c4:f166:555c:90a1:a48d]) by smtp.gmail.com with ESMTPSA id ay6-20020a17090b030600b00200b12f2bf3sm1196833pjb.51.2022.09.08.02.13.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Sep 2022 02:13:36 -0700 (PDT) Date: Thu, 8 Sep 2022 14:43:32 +0530 From: "Ritesh Harjani (IBM)" To: Alexey Lyashkov Cc: linux-ext4@vger.kernel.org, Theodore Ts'o , Andreas Dilger , Artem Blagodarenko , Andrew Perepechko Subject: Re: [PATCH] jbd2: wake up journal waiters in FIFO order, not LIFO Message-ID: <20220908091332.lowhekyxcs23kgtu@riteshh-domain> References: <20220907165959.1137482-1-alexey.lyashkov@gmail.com> <20220908054611.vjcb27wmq4dggqmv@riteshh-domain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220908054611.vjcb27wmq4dggqmv@riteshh-domain> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,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-ext4@vger.kernel.org On 22/09/08 11:16AM, Ritesh Harjani (IBM) wrote: > On 22/09/07 07:59PM, Alexey Lyashkov wrote: > > From: Andrew Perepechko > > > > LIFO wakeup order is unfair and sometimes leads to a journal > > user not being able to get a journal handle for hundreds of > > transactions in a row. > > > > FIFO wakeup can make things more fair. > > prepare_to_wait() will always add the task to the head of the list. > While prepare_to_wait_exclusive() will add the task to the tail since all of the > exclusive tasks are added to the tail. > wake_up() function will wake up all non-exclusive and single exclusive task > v/s > wake_up_all() function will wake up all tasks irrespective. > > So your change does makes the ordering to FIFO, in which the task which came in > first will be woken up first. With all other details which got discussed in other threads. This looks like the right thing to do. Reviewed-by: Ritesh Harjani (IBM)