Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp2054057lqo; Mon, 13 May 2024 06:45:33 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXCeancMZRoVcF1pwQzqp48mHKYVBfmtxV7x6PrwCfXqhe5eqT2XbQ9Ve9blCkEii0h8z3nH72a/oB3rDHok0hNOmHS8NNURddFtABpFQ== X-Google-Smtp-Source: AGHT+IGxd+9vESPdUQynFF/zX+xalpyVG2b/RyvBOfv8ZFo16lRU77M3j0VSF2MnUhc5GDCDHLh4 X-Received: by 2002:a05:6214:4519:b0:6a0:de15:7fcf with SMTP id 6a1803df08f44-6a168165ae6mr127110336d6.22.1715607933000; Mon, 13 May 2024 06:45:33 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715607932; cv=pass; d=google.com; s=arc-20160816; b=XKlDFD/SfvZ9i+1VGYZky2ydRExcVeo6x+nDF/5gDjPxnCHuxAze+9gDoR6TI4Tpxb A2O8/GIPe2J7py46nGAw+z2BoXD0UINf7ejjDTKEHQwmr/nYhfYz2InwM77Zt32/b/7g YB6Gm4nTVmheoNhQutXnR6kVJ4XLZ2mwAyM6Byug9ldFrQGJTWQ8q1G3tyYHFjjnN+nm mOn1Z6qakDGPEpX+q1bNPzT+CO/g9bbAtrMWQGleiVNEv3FNrh5Zrfjek8FfeTo+2xDm gH9BudDK/6cw8LJkWLcPJypRdj31F3/Svcv8NOT0XO1DHSM0KIx+xR/VtK9f8jUwc5Ue L9+w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature:dkim-signature:dkim-signature :dkim-signature; bh=+FQiO+ZNvZ+0y/Dlc2wC0U7u+dzb10N71bNPEiRmEzs=; fh=Yf8KxdvJj8sY/Bpxw4ThLi2J4FGkot3tSZ5JKsahmyk=; b=Qp4blWe7+5vGbEWoeLaAOyL9jSLFbAaTL3UDs1x1cRE/qYTj9dTt//vTcFiKdiJ6nR mqXAcBSinT0iULDEI4fIk+3vKYihJ786SYqDuLOHWZQBApOw/dsyf0/lgFR2Dnpe2k40 h/l7qfrJngvaoVyhy1m8/7KhABNsoN7x78OSlw3nEMWH/Eu9ior+lsKTDwkwPs4jsXbk Rc+GFVsSRWmKGb/TPol8plCseyg1jFstoi0BhiT46GHWgp/Ai3VWLebygwZ6oA+uSo/C DDadQ8pVqxnNHydYlqlUev0vvZwxWE5B5EDn37ecdsODB6IU/h29sgh2udo+TGpXevvS Fhfg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=EJ0jE588; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=EJ0jE588; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; arc=pass (i=1 spf=pass spfdomain=suse.cz dkim=pass dkdomain=suse.cz dkim=pass dkdomain=suse.cz); spf=pass (google.com: domain of linux-kernel+bounces-177647-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-177647-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 6a1803df08f44-6a15f1d6926si96457136d6.94.2024.05.13.06.45.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 May 2024 06:45:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-177647-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=EJ0jE588; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=EJ0jE588; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; arc=pass (i=1 spf=pass spfdomain=suse.cz dkim=pass dkdomain=suse.cz dkim=pass dkdomain=suse.cz); spf=pass (google.com: domain of linux-kernel+bounces-177647-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-177647-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 951DF1C2037E for ; Mon, 13 May 2024 13:45:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 490E7157E8B; Mon, 13 May 2024 13:41:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="EJ0jE588"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="4T7MawJs"; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="EJ0jE588"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="4T7MawJs" Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 93873154428; Mon, 13 May 2024 13:41:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715607701; cv=none; b=kCXnEKrk6rhFRXOPrQCSPKcFv3S6HddI5zMyS6/kmTxa6CLveG2gjNr6bp+d6Kx9wJl0TmYLoFKsqfV+J6/F63tTX99ftnObVzUK/yOo7VNamx5MGPOnkn9YMi2CFKyEwfryYxSgdvLQHf+vmHKh93J0JyHLspZXompr0L0MeaY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715607701; c=relaxed/simple; bh=/1JNBe9F/PZ69a8YFr7ZyMpTtpTq9sTHPBzD+2WUixo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Cn3Cx/zhGrtM1E9z+mU2UcmXNOkKNFy36COJEjV1xOspfTe4a6iRrR3gGHG/d09k7l34ncNB6LfE+fI8WbeWAF3csVISZ+ArzxFjaLyr5icbdiPM/GaG8YVcFZ4PQRGJApi6pkVScKTx2/sIFSIMLm/q+VgbNAHasJRSKFRr/Pw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz; spf=pass smtp.mailfrom=suse.cz; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b=EJ0jE588; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b=4T7MawJs; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b=EJ0jE588; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b=4T7MawJs; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.cz Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 42A275C0D9; Mon, 13 May 2024 13:41:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1715607697; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=+FQiO+ZNvZ+0y/Dlc2wC0U7u+dzb10N71bNPEiRmEzs=; b=EJ0jE588kgVEsvtw0YxaWwwpJhU93kJ4UhHmsTNCGxDXWpmpYLo6hB11FvcGhoQY3wRyuK MGDlfzVdalUJxqGxFsiro+aLWUrM4/zEK8GD3yAA0FWqFV2/+8cF1s7Y2jQMauoztZRw0V YZWDNVfRYfOgr03c1TD7CN8oXitF5+c= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1715607697; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=+FQiO+ZNvZ+0y/Dlc2wC0U7u+dzb10N71bNPEiRmEzs=; b=4T7MawJsM76mhrgutOvdUyTvOC4d4rxf9XDo0tnypfMlfNzXQIFosFTQ1CrAjavJEBm9ux S1SqrNNmzqLw/zDQ== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1715607697; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=+FQiO+ZNvZ+0y/Dlc2wC0U7u+dzb10N71bNPEiRmEzs=; b=EJ0jE588kgVEsvtw0YxaWwwpJhU93kJ4UhHmsTNCGxDXWpmpYLo6hB11FvcGhoQY3wRyuK MGDlfzVdalUJxqGxFsiro+aLWUrM4/zEK8GD3yAA0FWqFV2/+8cF1s7Y2jQMauoztZRw0V YZWDNVfRYfOgr03c1TD7CN8oXitF5+c= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1715607697; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=+FQiO+ZNvZ+0y/Dlc2wC0U7u+dzb10N71bNPEiRmEzs=; b=4T7MawJsM76mhrgutOvdUyTvOC4d4rxf9XDo0tnypfMlfNzXQIFosFTQ1CrAjavJEBm9ux S1SqrNNmzqLw/zDQ== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 144B613A67; Mon, 13 May 2024 13:41:37 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id R6PsBJEYQmaZDwAAD6G6ig (envelope-from ); Mon, 13 May 2024 13:41:37 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id 2EB84A08E9; Sun, 12 May 2024 13:26:39 +0200 (CEST) Date: Sun, 12 May 2024 13:26:39 +0200 From: Jan Kara To: Kemeng Shi Cc: tytso@mit.edu, jack@suse.com, linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 9/9] jbd2: remove unnecessary "should_sleep" in kjournald2 Message-ID: <20240512112639.6sprlmgbm7jrazsv@quack3> References: <20240506141801.1165315-1-shikemeng@huaweicloud.com> <20240506141801.1165315-10-shikemeng@huaweicloud.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240506141801.1165315-10-shikemeng@huaweicloud.com> X-Spam-Flag: NO X-Spam-Score: -2.80 X-Spam-Level: X-Spamd-Result: default: False [-2.80 / 50.00]; BAYES_HAM(-3.00)[99.99%]; DATE_IN_PAST(1.00)[26]; NEURAL_HAM_LONG(-1.00)[-1.000]; MID_RHS_NOT_FQDN(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; RCVD_VIA_SMTP_AUTH(0.00)[]; MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[]; MISSING_XM_UA(0.00)[]; TO_DN_SOME(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_FIVE(0.00)[5]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:email,imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns,suse.cz:email] On Mon 06-05-24 22:18:01, Kemeng Shi wrote: > We only need to sleep if no running transaction is expired. Simply remove > unnecessary "should_sleep". > > Signed-off-by: Kemeng Shi Nice! Feel free to add: Reviewed-by: Jan Kara Honza > --- > fs/jbd2/journal.c | 7 ++----- > 1 file changed, 2 insertions(+), 5 deletions(-) > > diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c > index ce9004f40ffb..65c6cfce9d92 100644 > --- a/fs/jbd2/journal.c > +++ b/fs/jbd2/journal.c > @@ -220,15 +220,12 @@ static int kjournald2(void *arg) > * so we don't sleep > */ > DEFINE_WAIT(wait); > - int should_sleep = 1; > > prepare_to_wait(&journal->j_wait_commit, &wait, > TASK_INTERRUPTIBLE); > transaction = journal->j_running_transaction; > - if (transaction && time_after_eq(jiffies, > - transaction->t_expires)) > - should_sleep = 0; > - if (should_sleep) { > + if (transaction == NULL || > + time_before(jiffies, transaction->t_expires)) { > write_unlock(&journal->j_state_lock); > schedule(); > write_lock(&journal->j_state_lock); > -- > 2.30.0 > -- Jan Kara SUSE Labs, CR