Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp604348imm; Fri, 22 Jun 2018 02:03:13 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLPxrEUrGwzgtFKYM2Rd8ST8Bb/gP9ON5YMaEW9oXFQdtwaMBeUrN2nI12O3/f/OzFCnCRj X-Received: by 2002:a63:6d05:: with SMTP id i5-v6mr638045pgc.321.1529658193624; Fri, 22 Jun 2018 02:03:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529658193; cv=none; d=google.com; s=arc-20160816; b=giEIL6Ru1kyvwqujrQAiK9XAQrREL9HTtWkOXnXVLqgI6EwCzstdeYYtMVoY4VEnRq 2sByeaSrizj+2sJ5/dhs50xxPZCC6Fhr0+VoCY7CwLbwNEQU6jaEghsserKWlet3dxhm e9yBNsOKmij48BGyQBiggfC86vvlGDUudTKe66xviWJnuOTKT2Q6i9KnbRyrajkzd94N F/5LvIZBdK1zRt6OVQxJMTQZxKkJ23kZEGEaSF6ET9RuFb3meHVoNMNU2qj1i1M9X4WG WOm3ASt0ATEQQx6Zl5nHzkesRufbFb0gsiYgnngEpehqqLm/I7RT/mN9oeObwd8WklaN GrPg== 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=j6Btf62SrO+tUlnnuaz1g1hKPW9/13dJEaPHlm5VO9w=; b=NcjC+RCxyZHxu/3EC99eUHlc79+RzrA6sR8zk49fHcBDxZLla4gEC4TjE/Dgvi7ifL 009upxa8ErfwHpH/IstGR9DKsQCgmbGe1ePgPQRxZvLQ4FXmxMM7oinXFJF/Lmlf8+Iy CRChlA6WXYoh49IEezEwPBgy21jJc7CsFFa5qTfHETnuQKLsbv4SrwBmohUy3GvUJlTI Y6FNT+Q7Po3obEf19wAiZGcfIgZBoVZZk8BjsuxbBPf26kSLn/ELIy2B+FXgrMhbVptr S223SGMLJbJ9EFloN2QwmBViQf3voh+iESgCbdWZ9ALzgch5Ow01GPpzi9ZFsAOMIa4a Ub7w== 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 h16-v6si7654384pli.14.2018.06.22.02.02.49; Fri, 22 Jun 2018 02:03:13 -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 S1752222AbeFVJBz (ORCPT + 99 others); Fri, 22 Jun 2018 05:01:55 -0400 Received: from mx2.suse.de ([195.135.220.15]:54522 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751624AbeFVJBw (ORCPT ); Fri, 22 Jun 2018 05:01:52 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext-too.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id B7231AF9C; Fri, 22 Jun 2018 09:01:51 +0000 (UTC) Date: Fri, 22 Jun 2018 11:01:51 +0200 From: Michal Hocko To: Mikulas Patocka Cc: jing xia , Mike Snitzer , agk@redhat.com, dm-devel@redhat.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: dm bufio: Reduce dm_bufio_lock contention Message-ID: <20180622090151.GS10465@dhcp22.suse.cz> References: <20180614073153.GB9371@dhcp22.suse.cz> <20180615073201.GB24039@dhcp22.suse.cz> <20180615115547.GH24039@dhcp22.suse.cz> <20180615130925.GI24039@dhcp22.suse.cz> <20180619104312.GD13685@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.5 (2018-04-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu 21-06-18 21:17:24, Mikulas Patocka wrote: [...] > > But seriously, isn't the best way around the throttling issue to use > > PF_LESS_THROTTLE? > > Yes - it could be done by setting PF_LESS_THROTTLE. But I think it would > be better to change it just in one place than to add PF_LESS_THROTTLE to > every block device driver (because adding it to every block driver results > in more code). Why would every block device need this? I thought we were talking about mempool allocator and the md variant of it. They are explicitly doing their own back off so PF_LESS_THROTTLE sounds appropriate to me. > What about this patch? If __GFP_NORETRY and __GFP_FS is not set (i.e. the > request comes from a block device driver or a filesystem), we should not > sleep. Why? How are you going to audit all the callers that the behavior makes sense and moreover how are you going to ensure that future usage will still make sense. The more subtle side effects gfp flags have the harder they are to maintain. > Signed-off-by: Mikulas Patocka > Cc: stable@vger.kernel.org > > Index: linux-2.6/mm/vmscan.c > =================================================================== > --- linux-2.6.orig/mm/vmscan.c > +++ linux-2.6/mm/vmscan.c > @@ -2674,6 +2674,7 @@ static bool shrink_node(pg_data_t *pgdat > * the LRU too quickly. > */ > if (!sc->hibernation_mode && !current_is_kswapd() && > + (sc->gfp_mask & (__GFP_NORETRY | __GFP_FS)) != __GFP_NORETRY && > current_may_throttle() && pgdat_memcg_congested(pgdat, root)) > wait_iff_congested(BLK_RW_ASYNC, HZ/10); > -- Michal Hocko SUSE Labs