Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp611735imm; Fri, 22 Jun 2018 02:10:40 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJA1eUxRi3y4LplQ74rwbm54h+hpA2Ci/ufIHkQpwTE60LGc/QI56fCsoGGbY9TUgAQs7/J X-Received: by 2002:a65:5185:: with SMTP id h5-v6mr704976pgq.0.1529658640299; Fri, 22 Jun 2018 02:10:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529658640; cv=none; d=google.com; s=arc-20160816; b=AKHN7oXTXT8ojVBZ8mIQ1Jst5PrdkZsBae9QuUrrqsbiLgkqJ54bCRJ2li2hXGobGb s0rrdlRtJDNGC1W2rHSP5fY8WA5V3Z9Y3wh7wfQ4OpkHwNLB7zAwAR1AtmjwbxUDb7vk bQTHXq9o+V/ewFghjVn3lJbS58A2ZnQk6XQfF0gUNTTI1zZJJ2hOaNIxMjPbrRJLJpdU QACiIZ8JimeENFoRqWtU/V3d0I4P6sO3ZdlYjHmZhrCsPLU3K4OETF+m2aQidQlnja8u 8erEnP4fxa4SPmpBv8kHqkReePQ8vHLacVTJ/4ppTQmZ+/jKvC+1sibOlTnzt0wKX5bb 6WnA== 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=bT8jXl+mV0bo23DLU2E+7BOSmLWFR7zJ6uioyhUYVqc=; b=0ArlJ7I7/bDvmUqTGv2OfTMAJuh9UBDunEYo7H+1bH6+NK+Ryh3uoK0aKv7xmXbGnR Io5eu4I5cZUj/6A0zldCtk3ZwVNKaAhAISoZFlqz1UJugepjFwDlfbgfChUyuV8nP3WD mcZza9l+hy+kqpAeLE0yV5NM6WyuWuvC6/faFk4IzMSDIrEoXys4Hk4jLV1Me2bttQP9 3IN7gd7Ybl/upgLefHlIPYPkNbTvvAFsR1m8B29gGP86xEOiOc4gUO3WpAkARtvKINh7 IgAONTrfLtyG9NuQ4BpP4m0Wr96HqeW6lZHUVoZKNL3NpqSPrBQS4bNy1bBIQqfZXUrY ZLMg== 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 u16-v6si5641692pgv.409.2018.06.22.02.10.17; Fri, 22 Jun 2018 02:10:40 -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 S1751297AbeFVJJi (ORCPT + 99 others); Fri, 22 Jun 2018 05:09:38 -0400 Received: from mx2.suse.de ([195.135.220.15]:55002 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751086AbeFVJJh (ORCPT ); Fri, 22 Jun 2018 05:09:37 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext-too.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 88059AC17; Fri, 22 Jun 2018 09:09:36 +0000 (UTC) Date: Fri, 22 Jun 2018 11:09:35 +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: <20180622090935.GT10465@dhcp22.suse.cz> References: <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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180622090151.GS10465@dhcp22.suse.cz> 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 Fri 22-06-18 11:01:51, Michal Hocko wrote: > On Thu 21-06-18 21:17:24, Mikulas Patocka wrote: [...] > > 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. So just as an excercise. Try to explain the above semantic to users. We currently have the following. * __GFP_NORETRY: The VM implementation will try only very lightweight * memory direct reclaim to get some memory under memory pressure (thus * it can sleep). It will avoid disruptive actions like OOM killer. The * caller must handle the failure which is quite likely to happen under * heavy memory pressure. The flag is suitable when failure can easily be * handled at small cost, such as reduced throughput * __GFP_FS can call down to the low-level FS. Clearing the flag avoids the * allocator recursing into the filesystem which might already be holding * locks. So how are you going to explain gfp & (__GFP_NORETRY | ~__GFP_FS)? What is the actual semantic without explaining the whole reclaim or force users to look into the code to understand that? What about GFP_NOIO | __GFP_NORETRY? What does it mean to that "should not sleep". Do all shrinkers have to follow that as well? -- Michal Hocko SUSE Labs