Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2768576yba; Mon, 15 Apr 2019 20:02:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqzHClW8W9hkxV55tBgyUA4Xm1zwKgJHvLLf22kjDA2DEnqGIgediM++iU7kBWb9t9BA3iRB X-Received: by 2002:a62:4554:: with SMTP id s81mr51741190pfa.66.1555383779421; Mon, 15 Apr 2019 20:02:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555383779; cv=none; d=google.com; s=arc-20160816; b=b0yvlIdO/uY7GdiauwEujMgRLkCek6Mu1ZibxB8MOfwjJ9G+PDTYlDR8Jp2foC0TqQ p2WcEDyHP/eQrYN5KqZmJziul1WYN/kRjhr62nMBE8/H1IBVKIfSeFxiMZZ7kNIlQQPi J81MB64WSfxp2s70IJqOe0tvYL4l7m7XVfwXso9cWPB8zOJNOkEhT4qHQck4t6qXe6DS XUzWnFxGMDKcXX/txhK9sZyP8ck8FzO6JUctVCa5o2/78AfbMsMdurmXceJQCfa8Vue3 eAhxEYMmGRqjGFhJAzQdbtSYdn9QEhS4mYNYuAAGs6SV99uFpUrGeOjkt6o0xQD6cc6w sdbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:from:subject:mime-version :message-id:date:dkim-signature; bh=iuIeQUAMTWIOwz/+wMTVC2rJ1Jb9H2uzMsmhSpHr4CI=; b=vDAlaJTOdyxKuYmX9/n93kPqa3BtaB0dlx2Vk9S9tgho0A9AyrKIHS3LM7UDIFByxm IiKw9BypXOKnOBARwbIuZpEbtfzhNe4nlOKOvHs2y71gXA/vlMbhBLGNupDrRw8oLz9v v/W/sAPVPafs1+4vFyurRHjXv5EUbvbtH4d1IwJMEGVHCQvPxrmmpJtctS3Pl9RveyyW S+41Iloy7azn6IDo87d1P2ss3QpVn2zI1zvyNwzLJ5kRKKyv09rKLy2WpEoYkrpI0CH4 JKzyeI6t5UQzw39fESjVMZeFthiU438vZgbzvyQXLHaQq4b7QQjoNRVo0TiOOYajbmBi MloA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=fnvln70V; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d186si49640650pfa.218.2019.04.15.20.02.43; Mon, 15 Apr 2019 20:02:59 -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; dkim=pass header.i=@google.com header.s=20161025 header.b=fnvln70V; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728435AbfDPDAZ (ORCPT + 99 others); Mon, 15 Apr 2019 23:00:25 -0400 Received: from mail-yw1-f73.google.com ([209.85.161.73]:47783 "EHLO mail-yw1-f73.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726775AbfDPDAX (ORCPT ); Mon, 15 Apr 2019 23:00:23 -0400 Received: by mail-yw1-f73.google.com with SMTP id z130so14630340ywb.14 for ; Mon, 15 Apr 2019 20:00:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:message-id:mime-version:subject:from:to:cc; bh=iuIeQUAMTWIOwz/+wMTVC2rJ1Jb9H2uzMsmhSpHr4CI=; b=fnvln70VUPw8oAUv8pSlp933t24EC4v+L98kvjdUpdJV4unSaz0qaOTJ4kDANowngl NtuNYmQdXEUi3aUzo8wfkTBm9Rrpk90shG1sf+UrhAN6KqHBmwdNI7Z6/j9GpEoVWfzO jDWNm0mGYxWzZIb+tLycnSLI2ii0+IfKuKfQW+JKVXoc7L+SW3yybK6t5eu+loHtcS7W 3OOE3krCnH+4rh0WORSthgLMvG9YtQakpQmGRlGVtUKvmw/P7uMY23GVkIuGwjA6yZYI pASm7Re41+k8ZTIqhR+fufOMSNYjSKowxRrqHebAZWwt98Kasc1teI2Xf/5UwSkeIFPP 0mGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=iuIeQUAMTWIOwz/+wMTVC2rJ1Jb9H2uzMsmhSpHr4CI=; b=k64gljzDsNRGcl3VBkQBuVFh5BHjJqUvkHbzBVdOg/CfhjAZv9mni4CNfCScLGDauk HgcIcOFU6cwGDCt42SSCNQ7WrxU9NVvEmlDjSCAeu2WX3pS7ZcI5QivnBCU7ZvVpZ2Oe EYer6KqVEmhuhfJffQ3dBqG/V/qtkESZbITcKkVGP80n/mVSwEgAqWrSyMvAkl2mWs7u glCVidJGJQa43X2P0LxyafmFhRXZ6EQbVynSLJbCXA6WjUdQVarb39Z0Vogxcnq2uHNn kSRMIWFd/P0OgL5AwkW1LOj2mcG0owEDQJTXmmn7Lsa7S7X4EJwBKCCWdOgXSup8Npa0 Ak/w== X-Gm-Message-State: APjAAAWaiHSGdaCvSYPj4cYKAP79kb/s67tduuXtJLAkKiSFJM3yHxji ZuVZU22YGqFqoAswwrMJ8BGimfS6NAE= X-Received: by 2002:a25:202:: with SMTP id 2mr14734788ybc.66.1555383622714; Mon, 15 Apr 2019 20:00:22 -0700 (PDT) Date: Mon, 15 Apr 2019 19:59:34 -0700 Message-Id: <20190416025934.115252-1-khazhy@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.21.0.392.gf8f6787159e-goog Subject: [PATCH] ext4: add cond_resched() to ext4_mb_init_backend() From: Khazhismel Kumykov To: tytso@mit.edu, adilger.kernel@dilger.ca Cc: linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org, Khazhismel Kumykov Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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