Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp5552640ybc; Wed, 27 Nov 2019 05:55:53 -0800 (PST) X-Google-Smtp-Source: APXvYqxs4rfxu3oNI+f+Ugnb6q667HEB2mIiW865Div2I0l0QC3TiqqodQWO7cwuiq2qyn6+XPBw X-Received: by 2002:a17:906:da04:: with SMTP id fi4mr29696258ejb.24.1574862953085; Wed, 27 Nov 2019 05:55:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574862953; cv=none; d=google.com; s=arc-20160816; b=jEuCB7sL9+UOmpFh9OfeoVy+E91mjmIV3iWPhYrSHqvhnBo22od2DZRFDsbCPrJ7oY pTuKhsNq9YlOi/Lj52OVuXdMe/eR/t8HNczCMl/lHWruOftJVVY8YS0B+2v0jfWqainI paElGjwsizj7smGPS3bESapuHJeOl1pRyGRN+YuBP3dDeqmzEhEhaH5H7opWDUNXMBoC SBndmf7JaY0RxsKsv2IIfc93CbznpSCSg0MNoJSHHgtcTpC+Oy08y6O1EwX9ISPCr8Zz SzlSFUCrDypQtdBEbqJLWbG5bzOqbPU6+LZeRVPUd9zrQ97PM8GLBGGqdAF08uWQgcG0 UusQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=B8AdbwkolH/zZhIni1bfNeVxIM4SCQqBBGLNihqtq4k=; b=Szb+hYv2sTkkijNQ3aZ7h7mVqaGxrFS26/2zqKvoNmPwuRlX0cMEb071Qnjw72r/+a Eg+Dx/DyXPdnO9DL5tarPkhVh6j744IDeVBay9H5YxQqgOXMV2GGFfSjUOjFM3obocqg BvpQhKLkau1J7fm4Fcc3RL/muEiwgCrhWW8VqRLqaJ4o8AHgmE+WeqU2oQcL8kBsWLoV iEsJFJnzaB7B4Abe2ktWPFhifcs7niJiynOGp1wXW/ZPFe0Ank2LtBSchojKQdo/4l6s iRd+EScspKrW2hsI64zMXWFrRpHvavRL953NonOMAqO1VNV4IEvLo0E3cZ/IliMe601Z 4wRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@toxicpanda-com.20150623.gappssmtp.com header.s=20150623 header.b=UMUZ5uIB; 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 i3si10848893ede.328.2019.11.27.05.55.29; Wed, 27 Nov 2019 05:55:53 -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; dkim=pass header.i=@toxicpanda-com.20150623.gappssmtp.com header.s=20150623 header.b=UMUZ5uIB; 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 S1726937AbfK0NyK (ORCPT + 99 others); Wed, 27 Nov 2019 08:54:10 -0500 Received: from mail-qt1-f193.google.com ([209.85.160.193]:44484 "EHLO mail-qt1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726558AbfK0NyK (ORCPT ); Wed, 27 Nov 2019 08:54:10 -0500 Received: by mail-qt1-f193.google.com with SMTP id g24so18568635qtq.11 for ; Wed, 27 Nov 2019 05:54:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toxicpanda-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=B8AdbwkolH/zZhIni1bfNeVxIM4SCQqBBGLNihqtq4k=; b=UMUZ5uIBB+/yf2ttfNNyKB03xeaf7fBour2E40Dlum/LB5P0LN0sdUowrAkAgtnnHO f53AMRdmdyEHPqp85m5Xp26jIE5VlmZm/y+01nTlV4dBn+sz5K/risEIyuyRbypHhDtS n+U8eNzA3W7b2JsN/wc1hMghtZLuLzC5MeiThjvJSm9DJWErzEUpL7nZWSJcdPpQvVqG F074glBrsV6nUgAesgDNxkPQxJpVV6ugeS8qbo2cwSJAQJuYbLxtB1DCHpXRb+aKWWiz Nt/CppCRI+PBuoB/JuzNfe1o7H5FpLaWG49+w49I0gqxCTbghpayGO7Oj1VyoSKeyv7C HnoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=B8AdbwkolH/zZhIni1bfNeVxIM4SCQqBBGLNihqtq4k=; b=L8rrLwpYR4LRGUd8MyHZg50itg0Y4KmNrdgwKYqxesCjlrNkeLpscbRAF9rYk3HmRe B20Ydu6IZnRgQ4lVQdPVMlO35Y0Pg3ANFbvR0zGz2aZ+KHmy1tQRKiTRs2cqfJaXa+Pa WwEmGBXDeNlRinBb3wAiwFBpXdczDLRCNCgjvCat8viaLsYkTEkxvvKPMOnfVc5PSd7F n0Myp9wbkpfS6r+SWylOYAhm4ld0eFRjs+vAvCylT6O7KlUxoKDclVmpcjIu2KfwaOYI KFca2x/aURQQcsGfRbrsb9+iJEurzLGUcOW4TPYpcBZm8NBwwX9SukOtQ6rI97/PcguW BTag== X-Gm-Message-State: APjAAAWgBlvQL0ZUOIQ2pyBta/0cm16PMtn3r3vYG1nwPazX5baK5m/q hcp2CueqliRlIm8bBcLtjyhIvA== X-Received: by 2002:ac8:6644:: with SMTP id j4mr38249574qtp.213.1574862847474; Wed, 27 Nov 2019 05:54:07 -0800 (PST) Received: from localhost ([2620:10d:c091:480::e4d7]) by smtp.gmail.com with ESMTPSA id x1sm6824750qke.125.2019.11.27.05.54.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 Nov 2019 05:54:06 -0800 (PST) Date: Wed, 27 Nov 2019 08:54:05 -0500 From: Josef Bacik To: David Sterba Cc: 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 Subject: Re: [PATCH 5/5] btrfs: Increase buffer size for zlib functions Message-ID: <20191127135405.326hmnja2sv3k2kh@macbook-pro-91.dhcp.thefacebook.com> References: <20191126144130.75710-1-zaslonko@linux.ibm.com> <20191126144130.75710-6-zaslonko@linux.ibm.com> <20191126155249.j2dktiggykfoz4iz@MacBook-Pro-91.local> <20191127121423.GQ2734@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191127121423.GQ2734@suse.cz> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 27, 2019 at 01:14:23PM +0100, David Sterba wrote: > 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. Only if we are maxed out, otherwise it tries to allocate. If it can happen it will happen, and I'll be the guy swearing in the middle of the night trying to deal with this making boxes fall over in production. I'm ok if we pre-allocate them first and only do 1 page on-demand, but having it always this way will bite us in the ass in production. Thanks, Josef