Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp809429imm; Fri, 22 Jun 2018 05:46:01 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLUcZ5I8fpF6qJSmj1FmOd+8jTVoQ/dtOmngKXCKOu1nrnVWvtsh2y7ECxbRA+03MtYqU18 X-Received: by 2002:a63:ac11:: with SMTP id v17-v6mr1319088pge.274.1529671561615; Fri, 22 Jun 2018 05:46:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529671561; cv=none; d=google.com; s=arc-20160816; b=ZkeEQCKI3F8uTOnby8tWA5nWROTbGrSwoNG4ey91gJYnWrr0NhSoOxzkBKiwL3nQR6 U8u8PkPerdh/C0FfZZi9IJjxbxyxRGjU0ap0CL+ZuNuU0Yo5pUsa6fEiwWYnknyqGXiB TJHAcI6CnwjMU8oimddyi9ENRackwy5XMzUDtKqatAH/TVzzZl1r0zvkK57d7EXs+s/U lFL4lI8JFcqPqaxpjxZiZByLHQ7xWopF/xZFE3/RsUyJPNvrZjhmBHaHtPzEp9gcJtAK ei31U0lN5QPmfH1ecvpTiMU7XOf/M+74eDJ3demHkkJl5h6h8XT+cguPcxwkK/+uOl2j 4/NQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date :arc-authentication-results; bh=b1fJNRmrwPv+0wo5YAbYO20wp47q4gpMI4ZW4iVVxSw=; b=UvM7QQIfOrqZrumVDvLIgMZVTYKSdV/OQWaaGmMZT9jgA4W59sUXpJ3msSyUaqU6sN kOSZuAAnaLFWs7bZo/i1deXLSo06x13qkXMI+TTahGmqPl8xfiaf4Ys0wxTXGDp5HjPw QNRdIm+ArdloeEb44Awu1ip0l34lT6sdIRSB+Yz3HIxaYZQvUF62WcMTwAml3MzzVj6F kgBaDTYtS7Cgq/f0hDSuL+SVhQegJJ4XNwKrBpd+j/rvJ9Z7/yrjKeotq7BqPWhgwMuY 0chwVwNoKcPBdToZfUHiixYqtEOhgNgeGjXaJQtRxu7FIrf3/dlS1VEFXZsA8ARuS2o1 vzUw== 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 67-v6si2016822pla.475.2018.06.22.05.45.46; Fri, 22 Jun 2018 05:46:01 -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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751400AbeFVMo6 (ORCPT + 99 others); Fri, 22 Jun 2018 08:44:58 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:44128 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751364AbeFVMo4 (ORCPT ); Fri, 22 Jun 2018 08:44:56 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 502E068803; Fri, 22 Jun 2018 12:44:56 +0000 (UTC) Received: from file01.intranet.prod.int.rdu2.redhat.com (file01.intranet.prod.int.rdu2.redhat.com [10.11.5.7]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 066DC1C71B; Fri, 22 Jun 2018 12:44:53 +0000 (UTC) Received: from file01.intranet.prod.int.rdu2.redhat.com (localhost [127.0.0.1]) by file01.intranet.prod.int.rdu2.redhat.com (8.14.4/8.14.4) with ESMTP id w5MCiq3J010927; Fri, 22 Jun 2018 08:44:52 -0400 Received: from localhost (mpatocka@localhost) by file01.intranet.prod.int.rdu2.redhat.com (8.14.4/8.14.4/Submit) with ESMTP id w5MCiqgC010923; Fri, 22 Jun 2018 08:44:52 -0400 X-Authentication-Warning: file01.intranet.prod.int.rdu2.redhat.com: mpatocka owned process doing -bs Date: Fri, 22 Jun 2018 08:44:52 -0400 (EDT) From: Mikulas Patocka X-X-Sender: mpatocka@file01.intranet.prod.int.rdu2.redhat.com To: Michal Hocko 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 In-Reply-To: <20180622090151.GS10465@dhcp22.suse.cz> Message-ID: 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> <20180622090151.GS10465@dhcp22.suse.cz> User-Agent: Alpine 2.02 (LRH 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Fri, 22 Jun 2018 12:44:56 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Fri, 22 Jun 2018 12:44:56 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'mpatocka@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 22 Jun 2018, Michal Hocko wrote: > 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. Because every block driver is suspicible to this problem. Two years ago, there was a bug that when the user was swapping to dm-crypt device, memory management would stall the allocations done by dm-crypt by 100ms - that slowed down swapping rate and made the machine unuseable. Then, people are complaining about the same problem in dm-bufio. Next time, it will be something else. (you will answer : "we will not fix bugs unless people are reporting them" :-) > > 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. I did audit them - see the previous email in this thread: https://www.redhat.com/archives/dm-devel/2018-June/thread.html Mikulas > > 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 >