Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp310796ybl; Tue, 7 Jan 2020 06:33:42 -0800 (PST) X-Google-Smtp-Source: APXvYqyiAxSy98rCaazpAaVQ1UZWmFHnX/QTOh3XqBXRA1JwAsJ90nlIfpO3yCeja3t0Nxe5LCio X-Received: by 2002:a9d:3e43:: with SMTP id h3mr61301otg.84.1578407622036; Tue, 07 Jan 2020 06:33:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578407622; cv=none; d=google.com; s=arc-20160816; b=QdFh8KRbV3zUGQ0+U/lmx7yWWueVAMyQKYcSVKb4DNDyIkcSgGAelm9MbBox8ux/dU Nrf4xi3D8RQwGqcd4aBf8HNIEnQXtp7HjFWvhDDJWQ9xS6hr3ctlrxHsyXFx6UIHEDFP uedzfdI9vaApk2Z2lJd7SdHnpOFwzrHXahJ4qypr9Qm4GmbfPhUM5EduRmP6ZG7wSj4i WDxy3pka4xxygHWlqFTkOaxf1e0GNrBXnewZNtL++/3cPavT0VjjfJ3f9oVzTINEs85h r/voKibEP8eRrbcvT4vRE1Hynb28k4Niv11Zhxs/TW2OpxjccyyGU0ArGIx0qHynP+ai cOwA== 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:mail-followup-to :reply-to:message-id:subject:cc:to:from:date; bh=ovCG352x9sFNYAwASgnEtxF5PguiqN27QcLs1La2Irc=; b=wDljLA47hkK+smbkBB+VrnaJVuacuL48lx3cQ6KgtX3uDQBwLTP2Jwu9cag0RzBDhq iMyy28f+RgofXlti7F8G5TXz0TAOBvqWNws98bRub+Q3byuFAVFVsw6mR81gGGMefyyf Mre/I1yZc7jO656EhEfwhuNmXfKF3Qv8gr6baHLtM6wRm5wHePUri08w1k8fudMHOYQd zinhcqeC2TsXUpSvj6CR0PMM5TtdXIcgTXJGDma9+oyZLkz6JJYMCZx1uv6PG6p8d6rV uYFiKxB2f5jsHxSxgdWw1vvCCusf4cJSITVzaF+5MBYCqA3H9JXgS3N327FTmOFFid6l Ht2g== 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 v11si30154953otr.158.2020.01.07.06.33.28; Tue, 07 Jan 2020 06:33:42 -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 S1728200AbgAGObM (ORCPT + 99 others); Tue, 7 Jan 2020 09:31:12 -0500 Received: from mx2.suse.de ([195.135.220.15]:58340 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727559AbgAGObL (ORCPT ); Tue, 7 Jan 2020 09:31:11 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id A9C43AC50; Tue, 7 Jan 2020 14:31:09 +0000 (UTC) Received: by ds.suse.cz (Postfix, from userid 10065) id 5F62EDA78B; Tue, 7 Jan 2020 15:30:59 +0100 (CET) Date: Tue, 7 Jan 2020 15:30:59 +0100 From: David Sterba To: Eduard Shishkin Cc: dsterba@suse.cz, Mikhail Zaslonko , Andrew Morton , Chris Mason , Josef Bacik , David Sterba , Richard Purdie , Heiko Carstens , Vasily Gorbik , Christian Borntraeger , Ilya Leoshkevich , linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 6/6] btrfs: Use larger zlib buffer for s390 hardware compression Message-ID: <20200107143058.GU3929@twin.jikos.cz> Reply-To: dsterba@suse.cz Mail-Followup-To: dsterba@suse.cz, Eduard Shishkin , Mikhail Zaslonko , Andrew Morton , Chris Mason , Josef Bacik , David Sterba , Richard Purdie , Heiko Carstens , Vasily Gorbik , Christian Borntraeger , Ilya Leoshkevich , linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org References: <20200103223334.20669-1-zaslonko@linux.ibm.com> <20200103223334.20669-7-zaslonko@linux.ibm.com> <20200106184305.GT3929@suse.cz> <664c2bbd-e06f-a4b3-fe21-982954b6330c@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <664c2bbd-e06f-a4b3-fe21-982954b6330c@linux.ibm.com> User-Agent: Mutt/1.5.23.1-rc1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 07, 2020 at 01:18:06AM +0100, Eduard Shishkin wrote: > >> @@ -61,7 +64,17 @@ struct list_head *zlib_alloc_workspace(unsigned int level) > >> zlib_inflate_workspacesize()); > >> workspace->strm.workspace = kvmalloc(workspacesize, GFP_KERNEL); > >> workspace->level = level; > >> - workspace->buf = kmalloc(PAGE_SIZE, GFP_KERNEL); > >> + workspace->buf = NULL; > >> + if (zlib_deflate_dfltcc_enabled()) { > >> + workspace->buf = kmalloc(ZLIB_DFLTCC_BUF_SIZE, > >> + __GFP_NOMEMALLOC | __GFP_NORETRY | > >> + __GFP_NOWARN | GFP_NOIO); > > Why do you use this wild GFP flag combination? I can understand NOWARN, > > but why the others? > > This addresses the following complaint about order 2 allocation with > GFP_KERNEL: > https://lkml.org/lkml/2019/11/26/417 > > Below a fallback to a single page is implemented, as it was suggested. > So, the initial (more costly) allocation should be made with minimal > aggression > to allow the allocator fail. Otherwise, that fallback simply doesn't > make sense. > Hence, such a combination. I see, please add a comment explaining that.