Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2737717imm; Tue, 4 Sep 2018 09:12:57 -0700 (PDT) X-Google-Smtp-Source: ANB0VdY1rzLJWejHQyx81XXWeDIlbbOJsYtXv/hyNYagIk5knqkHLF50HypYbKPOxK35KI3tSj/m X-Received: by 2002:a63:b00f:: with SMTP id h15-v6mr32292592pgf.442.1536077577421; Tue, 04 Sep 2018 09:12:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536077577; cv=none; d=google.com; s=arc-20160816; b=Y1Qavif8Dsc74xRRsyf3yrlsdgXsxSnnK4PzVGDKVk3Eb4dor+Z4YSz5c7GchOEgxK HOBgKy2kFueL1M3mKCdvMnnCWwmG+k/NXL4syydDVw9ef0L3yMhJZkKmgPLk2aCwjUdA tMwMdH4yx35g2cbEu9wua6oRqG/hYUKef1vG7UNU7Q6NbLb+2nqbNR5eIMLhjBbWt0j/ wt8ufLebp3NPhBxOAYFMmtJQuOWAfzjqn3dIOmxC3rGv2NbennsXvrLXz6zObR7BZi0Y rAi/qGXUG68zTW9IIx0IszPmgBB++P4wAyoSEGR/QZylkgaAQqGt2nU4QEZF0naVgHzi 1wpw== 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:arc-authentication-results; bh=TKwxddAVXVPHP7oPLbqEbkPoH9nHud7TyHzfu9QGyqk=; b=gNlz1hW13lXPPVP2nhXcwb6PgjVOpAo+6I89Ka23kuGKzJ5WagFyUR1CT0gdmvvPBp Zx5ymtp2QBNTkWILjbDVHJjoQakpRW+sesf5f3D9W7xwFHv32SIvT4ve5NkrtVM6gNyi 685CmX2gTlVO3IDp9ztE2EFDkmAEmxtAHpyxLfTFxnEf/CqZV2qBpuxBapbBMSPSIck5 eOO93XbRzRmlaLx9CHX+lX+f1OH5/9AgG9kXVKUHeMi70K/VnELbOpGbXbW00z2zFtq9 6Wf/hfN+ovggk110cft9pafj730wLr2Ey1RjafpRgcxEKXejcFWqL9BVqRNnWjcaCWjM 2IUA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f5-v6si23321028plf.411.2018.09.04.09.12.12; Tue, 04 Sep 2018 09:12:57 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727497AbeIDUej (ORCPT + 99 others); Tue, 4 Sep 2018 16:34:39 -0400 Received: from mx2.suse.de ([195.135.220.15]:55166 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726377AbeIDUei (ORCPT ); Tue, 4 Sep 2018 16:34:38 -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 BD44EAE1F; Tue, 4 Sep 2018 16:08:50 +0000 (UTC) Date: Tue, 4 Sep 2018 18:08:49 +0200 From: Michal Hocko To: Mike Snitzer Cc: Mikulas Patocka , jing xia , agk@redhat.com, dm-devel@redhat.com, linux-kernel@vger.kernel.org Subject: Re: dm bufio: Reduce dm_bufio_lock contention Message-ID: <20180904160732.GO14951@dhcp22.suse.cz> References: <1528790608-19557-1-git-send-email-jing.xia@unisoc.com> <20180612212007.GA22717@redhat.com> <20180614073153.GB9371@dhcp22.suse.cz> <20180904070824.GH14951@dhcp22.suse.cz> <20180904151844.GB10112@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180904151844.GB10112@redhat.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 Tue 04-09-18 11:18:44, Mike Snitzer wrote: > On Tue, Sep 04 2018 at 3:08am -0400, > Michal Hocko wrote: > > > On Mon 03-09-18 18:23:17, Mikulas Patocka wrote: > > > > > > > > > On Wed, 1 Aug 2018, jing xia wrote: > > > > > > > We reproduced this issue again and found out the root cause. > > > > dm_bufio_prefetch() with dm_bufio_lock enters the direct reclaim and > > > > takes a long time to do the soft_limit_reclaim, because of the huge > > > > number of memory excess of the memcg. > > > > Then, all the task who do shrink_slab() wait for dm_bufio_lock. > > > > > > > > Any suggestions for this?Thanks. > > > > > > There's hardly any solution because Michal Hocko refuses to change > > > __GFP_NORETRY behavior. > > > > > > The patches 41c73a49df31151f4ff868f28fe4f129f113fa2c and > > > d12067f428c037b4575aaeb2be00847fc214c24a could reduce the lock contention > > > on the dm-bufio lock - the patches don't fix the high CPU consumption > > > inside the memory allocation, but the kernel code should wait less on the > > > bufio lock. > > > > If you actually looked at the bottom line of the problem then you would > > quickly find out that dm-bufio lock is the least of the problem with the > > soft limit reclaim. This is a misfeature which has been merged and we > > have to live with it. All we can do is to discourage people from using > > it and use much more saner low limit instead. > > > > So please stop this stupid blaming, try to understand the reasoning > > behind my arguments. > > Yes, this bickering isn't productive. Michal, your responses are pretty > hard to follow. I'm just trying to follow along on what it is you're > saying should be done. It isn't clear to me. > > PLEASE, restate what we should be doing differently. Or what changes > need to happen outside of DM, etc. For this particular case I can only recommend to not use the memcg soft limit. This is guaranteed to stall and there is no way around it because this is the semantic of the soft limit. Sad, I know. Regarding other other workloads. AFAIR the problem was due to the wait_iff_congested in the direct reclaim. And I've been arguing that special casing __GFP_NORETRY is not a propoer way to handle that case. We have PF_LESS_THROTTLE to handle cases where the caller cannot be really throttled because it is a part of the congestion control. I dunno what happened in that regards since then though. -- Michal Hocko SUSE Labs