From patchwork Thu Oct 10 20:19:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heitor Alves de Siqueira X-Patchwork-Id: 1174793 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46q2WJ5gdBz9s7T; Fri, 11 Oct 2019 07:19:56 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1iIeuf-0005tH-65; Thu, 10 Oct 2019 20:19:53 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1iIeub-0005s1-4M for kernel-team@lists.ubuntu.com; Thu, 10 Oct 2019 20:19:49 +0000 Received: from mail-qk1-f197.google.com ([209.85.222.197]) by youngberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1iIeua-0008Cw-T6 for kernel-team@lists.ubuntu.com; Thu, 10 Oct 2019 20:19:48 +0000 Received: by mail-qk1-f197.google.com with SMTP id x77so6617664qka.11 for ; Thu, 10 Oct 2019 13:19:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=cDk91e86uvhVuudWL6GL5KOiFO82t8s8ASky50OCNzk=; b=okuvlgIv1MrG0M2q2kVRvQiIeHmd0QSZPjeIf7UE7CpPBMtwQfCW4iMJr0YCg48Qaj vvT4zbsr1XXIHADdb5aUpRj19onLEs6I9GFpZArOxKgR1sGvGpgTju3Ni6gSlQUkUrX9 6nHPdWAd502zyVzCPw1Qlcmm+6ropxe1n+wwXHJcsk/hlZmDncCo6tv20Qx9eT+PjouF 6fmFn799BEY1pRChhIs1XuzHcw+HyvDupma5dDXdEc3QKTMimjRGzvv4Z+1PCVdZ+QkD TMWP7QQ4Q0bGR0JCSoQo5IBp46Vi7N+b0Q9L0RPl+OVWQvIqXmoAnjlZvjAzhwyvoOkt 32ig== X-Gm-Message-State: APjAAAVJ45e6llthwmtaDxvWhABxAtbtEaBFgb/Zi84TJceKQ3vVxpPv cfsEEqUOrdu3QvLMvjKiHS8qiLso58khpUO9Gl72fZqilplBEiviHPQizpSWpr6nPFlQpoV2P5l rvjrwU/qCM6Qziv2FYVwDbaExViUu0hISHLeeMfV60A== X-Received: by 2002:a37:8dc6:: with SMTP id p189mr11623081qkd.132.1570738787816; Thu, 10 Oct 2019 13:19:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqyg8g6rnuA7Nw3/SmBfXe6wBqwho76ewqpQ8tJj4lp214BvRGLQvWFmaJxdTHGCOY2ZhfDLVQ== X-Received: by 2002:a37:8dc6:: with SMTP id p189mr11623061qkd.132.1570738787563; Thu, 10 Oct 2019 13:19:47 -0700 (PDT) Received: from localhost.localdomain ([2804:14c:4e3:8352:edf7:8648:100d:9be9]) by smtp.gmail.com with ESMTPSA id 207sm2447765qkh.33.2019.10.10.13.19.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Oct 2019 13:19:47 -0700 (PDT) From: Heitor Alves de Siqueira To: kernel-team@lists.ubuntu.com Subject: [PATCH 1/1][SRU][X] bcache: add cond_resched() in __bch_cache_cmp() Date: Thu, 10 Oct 2019 17:19:40 -0300 Message-Id: <20191010201940.30382-3-halves@canonical.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191010201940.30382-1-halves@canonical.com> References: <20191010201940.30382-1-halves@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Shile Zhang BugLink: https://bugs.launchpad.net/bugs/1840043 Read /sys/fs/bcache//cacheN/priority_stats can take very long time with huge cache after long run. Signed-off-by: Shile Zhang Tested-by: Heitor Alves de Siqueira Signed-off-by: Coly Li Signed-off-by: Jens Axboe (backported from commit d55a4ae9e1af5fb1657e38284ef46c56e668efdb) Signed-off-by: Heitor Alves de Siqueira --- drivers/md/bcache/sysfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/md/bcache/sysfs.c b/drivers/md/bcache/sysfs.c index 940ba3e1bad1..057804caeed2 100644 --- a/drivers/md/bcache/sysfs.c +++ b/drivers/md/bcache/sysfs.c @@ -820,7 +820,7 @@ SHOW(__bch_cache) if (attr == &sysfs_priority_stats) { int cmp(const void *l, const void *r) - { return *((uint16_t *) r) - *((uint16_t *) l); } + { cond_resched(); return *((uint16_t *) r) - *((uint16_t *) l); } struct bucket *b; size_t n = ca->sb.nbuckets, i;