Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp5450733ybc; Wed, 27 Nov 2019 04:18:21 -0800 (PST) X-Google-Smtp-Source: APXvYqxlJNAeSVn45YtrZGUve3joLVGoQqo/AXdo9F9aVzktsOTet/oxti6Ndc0+mFRKxqgPdRsM X-Received: by 2002:a05:6402:1d8f:: with SMTP id dk15mr2233995edb.29.1574857101404; Wed, 27 Nov 2019 04:18:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574857101; cv=none; d=google.com; s=arc-20160816; b=M1Et9osVvoOxRs89YnFJ/VPP5X3WA3DAM0zRQoK4VgjwI4vRUOZBTbSbcqe7EMz/yu 7G3+J+9rO0+wlWRjGYsi14KrcqmeDCjhqCivDNC37DmjBBQTzpH0Th5NU7E+/FQlDq1L c6aUhB8uYQVoeBFeGAcd/fHXCi0NUoLBmc+rfg+C9JfnzCkv+tKIiRCXeKtDG2VAYTIm kcbjEmrs1itn+OoX8RsvJDAllX8aSfoR1Ir9mp3dk3jtySxdCqw9xoTnwmuhXiUyIKUs K3/c8Ku+cRWboFjP/qepSAhF6Y0DG1T27NcqxwA95gFXKFo9RS/4t18aV9fHLotFDr5J 7YRA== 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=1RbxX/EN7eQ8DAe2uUKBqm4VRn+RilDXNLW5RYXsVbY=; b=SQgw7mhQieETIq9vMGqLrhEl0bvnVzdSZJ/MM0RwexrWn0L2X+SD1nutatFDD60tf+ IwADPS8dWXbFDVlvmMw5MVHYyaTpseYpq9Fl0l+zXeC4a5/NDkCuA+FS7UpGxjJ+TxhJ EKOU+riG2OAsuH0+C/n9DB2wqA/LL0boiYr7q1/ezXV5FkumaAvvJDhcPcxsNEsesfSF e7i9+xKz09W0fEHBqM3s6Qo1YZN5OUJCQN1kXctiIRdUHZ7PwhNtoEjjmHE7EPiZfZtl ZHnneI0IOfffhjX6Smird3+5/uiwYGtNjI616HB7dGlUaUMU1NIqAs6vxfCNwKGcKyz8 WuhQ== 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 u30si2229217edd.119.2019.11.27.04.17.50; Wed, 27 Nov 2019 04:18:21 -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 S1726729AbfK0MO2 (ORCPT + 99 others); Wed, 27 Nov 2019 07:14:28 -0500 Received: from mx2.suse.de ([195.135.220.15]:54400 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726515AbfK0MO1 (ORCPT ); Wed, 27 Nov 2019 07:14:27 -0500 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 C33C1ADB3; Wed, 27 Nov 2019 12:14:25 +0000 (UTC) Received: by ds.suse.cz (Postfix, from userid 10065) id 6649CDA733; Wed, 27 Nov 2019 13:14:23 +0100 (CET) Date: Wed, 27 Nov 2019 13:14:23 +0100 From: David Sterba To: Josef Bacik Cc: Mikhail Zaslonko , Andrew Morton , Chris Mason , David Sterba , Richard Purdie , Heiko Carstens , Vasily Gorbik , Christian Borntraeger , linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 5/5] btrfs: Increase buffer size for zlib functions Message-ID: <20191127121423.GQ2734@suse.cz> Reply-To: dsterba@suse.cz Mail-Followup-To: dsterba@suse.cz, Josef Bacik , Mikhail Zaslonko , Andrew Morton , Chris Mason , David Sterba , Richard Purdie , Heiko Carstens , Vasily Gorbik , Christian Borntraeger , linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org References: <20191126144130.75710-1-zaslonko@linux.ibm.com> <20191126144130.75710-6-zaslonko@linux.ibm.com> <20191126155249.j2dktiggykfoz4iz@MacBook-Pro-91.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191126155249.j2dktiggykfoz4iz@MacBook-Pro-91.local> 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, Nov 26, 2019 at 10:52:49AM -0500, Josef Bacik wrote: > On Tue, Nov 26, 2019 at 03:41:30PM +0100, Mikhail Zaslonko wrote: > > Due to the small size of zlib buffer (1 page) set in btrfs code, s390 > > hardware compression is rather limited in terms of performance. Increasing > > the buffer size to 4 pages would bring significant benefit for s390 > > hardware compression (up to 60% better performance compared to the > > PAGE_SIZE buffer) and should not bring much overhead in terms of memory > > consumption due to order 2 allocations. > > > > Signed-off-by: Mikhail Zaslonko > > We may have to make these allocations under memory pressure in the IO context, > order 2 allocations here is going to be not awesome. If you really want it then > you need to at least be able to fall back to single page if you fail to get the > allocation. Thanks, The allocation is only for the workspace and it does not happen on the IO path for each call. There's the pool and if btrfs_get_workspace alloc_workspace fails, then there's fallback path to wait for an existing workspace to be free. The order 2 allocation can put more pressure on the allocator though so it's possible to have effects in some corner cases, but not in general. I don't think the single page fallback code is needed. And of course evaluation of the effects of the larger zlib buffer should be done, it could improve compression but probably at the cost of cpu time. Also decompression of blocks created on new code (4 pages) must work on the old code (1 page).