Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp5100472imb; Thu, 7 Mar 2019 07:46:51 -0800 (PST) X-Google-Smtp-Source: APXvYqzpRGzSa6n+h+bP6wXKj6JCzh7NbCTT11mDwiS7zcpT13N6+DdpsvvVjofUDWtYt2EEahNy X-Received: by 2002:a62:b248:: with SMTP id x69mr13320965pfe.256.1551973611809; Thu, 07 Mar 2019 07:46:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551973611; cv=none; d=google.com; s=arc-20160816; b=NjEAsfSg5FdTwgCnQiNwYbdBqcmlDuqPXweQWocfz7Iw10dFuJZNrfE283MGGIoFXI wM/SeQ/ciV/8GPchcoxGHJLaANXoTkscUFzTvadE8D8cYyLUCjkvSEU0mM5sK57X+8xF jrjli52KqgjveY42Ruvx8cW3hJD+nSdRr9V+nkMaeqkAFQEyEB8C2EmZZMYyz+YMdPWJ 29k8YQMhaGShaCo8oQZ7GnGQNjsEGkNUarzDPRMUMYrkntvm4i1wCZgJS7zI0CiqELJ5 rMACCaXljcTPCXRAXcPvU1KM8/pm5LSjWHzonJcGfZ6P+yh8UycAU50qqlFEG+DoHFIE 0UxQ== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=xt2z/6hk09/4I27JhgpPlUIc4dqiddxU/dxdkRp9qKc=; b=hWtRf3Jn7QU34HoDyqlwNTJsA1QIV3VMiQ/BCGz36Rezg1lSthIeMnI9ee7XyikbTS gJRvKnA2Vu02pTblS9NkgnNpPkVfdnifS3Tyr4uGtTLop8zFNADp5PYNq57zKxIH/0N2 uSxvfazHhBIpbzNz96saYaVshjnvssvY49ZbtD43ANEJvenVdldSpBM3r6wBj1QUHXiL BDdsMt+Y4No1ZWUiGjHi9rcmMp3Drkn/MMTTfDoxCkaR4YeZhvxXIAywBZ68wAFpZRjy 8QCsjVnuDqOfArpSapX4eiMsM1T1e56jmoxb3DutRmNEC1kHHFhApV1SJvu+Qch2FFMY LsSA== 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 f30si4126542pgf.208.2019.03.07.07.46.35; Thu, 07 Mar 2019 07:46:51 -0800 (PST) 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 S1726596AbfCGPoX (ORCPT + 99 others); Thu, 7 Mar 2019 10:44:23 -0500 Received: from mx2.suse.de ([195.135.220.15]:54090 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726185AbfCGPoW (ORCPT ); Thu, 7 Mar 2019 10:44:22 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 84B83AA71; Thu, 7 Mar 2019 15:44:21 +0000 (UTC) Received: from shadow.suse.cz (shadow.suse.cz [10.100.13.111]) by dark.suse.cz (Postfix) with ESMTP id 480F312CC0A; Thu, 7 Mar 2019 16:44:21 +0100 (CET) Received: by shadow.suse.cz (Postfix, from userid 10002) id 3E0F744700; Thu, 7 Mar 2019 16:44:21 +0100 (CET) Date: Thu, 7 Mar 2019 16:44:21 +0100 From: Vojtech Pavlik To: Coly Li Cc: Shile Zhang , Kent Overstreet , linux-bcache@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] bcache: add cond_resched() in __bch_cache_cmp() Message-ID: <20190307154421.GA8829@suse.cz> References: <1551935728-243664-1-git-send-email-shile.zhang@linux.alibaba.com> <24916a71-39ff-7324-ad12-9d79cc68d0da@suse.de> <3640cd7f-f32a-1509-dbef-6000b6e14e75@linux.alibaba.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Bounce-Cookie: It's a lemon tree, dear Watson! 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 Thu, Mar 07, 2019 at 11:36:18PM +0800, Coly Li wrote: > On 2019/3/7 11:06 下午, Shile Zhang wrote: > > > > On 2019/3/7 18:34, Coly Li wrote: > >> On 2019/3/7 1:15 下午, shile.zhang@linux.alibaba.com wrote: > >>> From: Shile Zhang > >>> > >>> Read /sys/fs/bcache//cacheN/priority_stats can take very long > >>> time with huge cache after long run. > >>> > >>> Signed-off-by: Shile Zhang > >> Hi Shile, > >> > >> Do you test your change ? It will be helpful with more performance data > >> (what problem that you improved). > > > > In case of 960GB SSD cache device, once read of the 'priority_stats' > > costs about 600ms in our test environment. > > > > After the fix, how much time it takes ? > > > > The perf tool shown that near 50% CPU time consumed by 'sort()', this > > means once sort will hold the CPU near 300ms. > > > > In our case, the statistics collector reads the 'priority_stats' > > periodically, it will trigger the schedule latency jitters of the > > > > task which shared same CPU core. > > > > Hmm, it seems you just make the sort slower, and nothing more changes. > Am I right ? Well, it has to make the sort slower, but it'll also avoid hogging the CPU (on a non-preemptible kernel), avoiding a potential soft lockup warning and allowing other tasks to run. -- Vojtech Pavlik VP SUSE Labs