Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp488575yba; Thu, 18 Apr 2019 04:54:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqxSa3EB6GE9Xrtb/waOcujo8Zy+97lyI5gSjh2JZ/yhPDe/6lphDS8Fcm41YBoAGzDK8fHk X-Received: by 2002:a17:902:47c2:: with SMTP id d2mr94463284plh.277.1555588487034; Thu, 18 Apr 2019 04:54:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555588487; cv=none; d=google.com; s=arc-20160816; b=w5bLth2AWGPqcjtHTDoA9wAfVZQppHayuXsOWRfeT1D5dQVJo5ddQuzAeySXvOIAEL PXmK8AgeZagr+N5T9bitwEHQR2f0IjtLUek4IlmceeeigC0qIkIv7P8WrLzwHCSUtmma 9VJ5xcRk7mzI+VR0rQ8R4C7cjgow4Jkm92xTjSO4s4JlyrxpkHFrCdRxRdAajesxD2Ma j2QEdGBSrUy7B1HdL2yTZk0EWiqjfSarXLr9Y3yp0mkCEisAlpxZHTozRp7bMGPbei6p aMyXdxjR5lq/ywWJqg0ffoqGw06YvuDHsOuR/ima4wV0zL2iWnC1UarvELl+Y/JhwgGx VUsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=8o1xmDQxX4TisIN4TUuAMiIhNzy807ARwNkZA5y7OD8=; b=kV4qMzAkuID13XLJp03BEtm82Fy8aml4Z39LAWyv87qBYmKhKkPgeaPJ9Lqdqdk9iM gddr5gfS4QOgnQFmOErxqs+3jOH8ImBc7/ut1dAawq5ENrOaDTwucP+2xtYGHKxsVXaf bpOMNMOcDX/GhedixVEJcuCn0Az0s5gbfQbxN/aGuFBizKDlBV+zeZ81iS3zgWkdlNHm U3jKBGetJ+F817VWld+EhMHDoMIp62lwtEpmhv3n0YIZR4g7ouj0REc1yXl+fjs/+Ei9 ylqEKzxbcenGyuVgbGCaVUdUkt1DHHNQEqqfDfjsgy2+lQex+62bC7t8UaG33Sokn6v7 EUmQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v6si1848082plp.296.2019.04.18.04.54.31; Thu, 18 Apr 2019 04:54:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388876AbfDRLxb (ORCPT + 99 others); Thu, 18 Apr 2019 07:53:31 -0400 Received: from mx2.suse.de ([195.135.220.15]:46218 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727807AbfDRLxa (ORCPT ); Thu, 18 Apr 2019 07:53:30 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 65D40AEBC; Thu, 18 Apr 2019 11:53:29 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id B2B091E15AE; Thu, 18 Apr 2019 13:53:26 +0200 (CEST) Date: Thu, 18 Apr 2019 13:53:26 +0200 From: Jan Kara To: Khazhismel Kumykov Cc: tytso@mit.edu, adilger.kernel@dilger.ca, linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] ext4: add cond_resched() to ext4_mb_init_backend() Message-ID: <20190418115326.GE28541@quack2.suse.cz> References: <20190416025934.115252-1-khazhy@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190416025934.115252-1-khazhy@google.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon 15-04-19 19:59:34, Khazhismel Kumykov wrote: > on non-preempt kernels for filesystems with large number of groups we > may take a long time (>50 ticks) initializing all the groups. > > Signed-off-by: Khazhismel Kumykov Thanks for the patch. I'm not opposed to this but I'm just wondering: Has this caused any real issues to you? Or how have you come across this particular loop? Because I'd think we have more similar loops in ext4 codebase... Honza > --- > fs/ext4/mballoc.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c > index 8ef5f12bbee2..c89f497ccf50 100644 > --- a/fs/ext4/mballoc.c > +++ b/fs/ext4/mballoc.c > @@ -2490,6 +2490,7 @@ static int ext4_mb_init_backend(struct super_block *sb) > sbi->s_buddy_cache->i_ino = EXT4_BAD_INO; > EXT4_I(sbi->s_buddy_cache)->i_disksize = 0; > for (i = 0; i < ngroups; i++) { > + cond_resched(); > desc = ext4_get_group_desc(sb, i, NULL); > if (desc == NULL) { > ext4_msg(sb, KERN_ERR, "can't read descriptor %u", i); > -- > 2.21.0.392.gf8f6787159e-goog > -- Jan Kara SUSE Labs, CR