Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6445463imu; Sun, 2 Dec 2018 18:31:37 -0800 (PST) X-Google-Smtp-Source: AFSGD/WZWdt/Dh5UPgLdbnQppdYn33Xt6r4ah0TpAog3pNYy5RzSehedVT9LXIRN7MOIhgCeqrvu X-Received: by 2002:a65:6094:: with SMTP id t20mr11694616pgu.285.1543804297248; Sun, 02 Dec 2018 18:31:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543804297; cv=none; d=google.com; s=arc-20160816; b=uS5d2Y7RzUGqTmoUZk5t5y6/2ulD+pyKX03nuw2L+pnTNlUPOM2Ey6J1UqBpuZ+fRu 9M5VVXL5sbWuI4vQxqqRwPex/jiW88+nxMZFLVq4ZI0M5LTzAsp25jtwJo/gY4HZSzsv +TZjbNAa57WqNs9cwmeUqaN81E3bxdrf+YbPhcvo3PZAh5R2XmLQ34esmUbk6PLEH4ux PPYM2BfvXOd8Hzu7U1+vxPE8AIXfW+R+kK9BGL88oRy59i+CBFfHs5isVKEq5EsmhMeI VdyyaG+uWQ6dkmQt6C7jQuUdRjaXWziM63DZPFkkT1G43rAblpHYGmVmoYCZxCsyIeyL K7sA== 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:dkim-signature; bh=nDbm3Gg62A+NnRlRNNyK9kjnE0VQuTyeHAxME3tXvvA=; b=C1YVpXDLSfwQKQziNELEDzkeXtflzZHYjplA0N27Hg98W0ga6bP0pL4Cw2TG0LbnsH NSv4N62yG1NvIDrWE8N8d2+i3w8ex8F8cZb5iK9WPn5rWCVC9zOaDuHaYv0pumBP7Qu/ DBySuahjyhuwBFJmdyx8sjSaH5jRC24twScfLT5QQuSB7UA/SMJVvTzMRJ5U52BvyPJ6 hSZcT9MoGl++KEbmP2cLQIHOkdittwJ4mDH/uASHbsIrvf1fiSWjL7rIgHJLwGtkCHwz nEHl83vCvTqsQnuk9knUBukJYFPooNmH6rTPX0q1vjSkWKtRCKHWVd1OC+G8WlKOoBK0 K/AA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=IzRvxRE3; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b89si12696132pfj.207.2018.12.02.18.31.22; Sun, 02 Dec 2018 18:31:37 -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=@gmail.com header.s=20161025 header.b=IzRvxRE3; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725806AbeLCCas (ORCPT + 99 others); Sun, 2 Dec 2018 21:30:48 -0500 Received: from mail-pl1-f195.google.com ([209.85.214.195]:35720 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725792AbeLCCas (ORCPT ); Sun, 2 Dec 2018 21:30:48 -0500 Received: by mail-pl1-f195.google.com with SMTP id p8so5660959plo.2 for ; Sun, 02 Dec 2018 18:30:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=nDbm3Gg62A+NnRlRNNyK9kjnE0VQuTyeHAxME3tXvvA=; b=IzRvxRE3XUVhh9ZfVMTneM+IDX1Cj4BjFqqJxEZqp3H0tKIWkxcmH6tFzrLra/IEip YiiJIrdfWbkFkYH6ijAaXvfJWlKisLZzg16yy+dFgORrKvTrCZ3+a0PK9gKSwE2DXEDG VigteSUig8cPkOseH6P962saiRevfPMOXdRuw5jHz8hXfGLYsKmkFHJ7m+t1Vlf21ICF oPFObfsLQJec5Gcvl5tsVWUTXHsxSti5R/bkrZDUf0mF1GWRRGgGu8GYhJpbz/fYRYaJ +l+iD3SIx7k1YxM3sr2QeqPLwurp5naN4OeE103CmXpGgiXsnARf8ThExLGv4ex88FW1 +GPQ== 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:user-agent; bh=nDbm3Gg62A+NnRlRNNyK9kjnE0VQuTyeHAxME3tXvvA=; b=CXeT2YPjoFWXjyv2/kFFfcv3fDj5O13Mi2eqsUPCdaMnrZddN2xbxW2KKvcJPAbHDK meO5dDaNoYS0tn8K3IAvUDjCqfaTWS/LgeE1aetHfB5I/BOll/GZwhQVGWnKK0xvRijz HeIdfolH+cl6/9T9/HmL0pzuevQF2fzRMWclnLZSRl7DLRDEf1dlhDuanEIqmmGvrr8z FqDAA27WOtUu+UZSm1UKhmHhK8Viuv6ecL7rnR9Y+buzE2Ao6ZuJxUPvUXbBqFA0k8AG dl9kAIMn4VRD10Gu3CRfpN03h6y48QhxtN5TCtt5MSFzHd/UzNI6LBn/73QdkVeaFHI3 poWQ== X-Gm-Message-State: AA+aEWZkdbGk3CQQj74wj3nEKivs+wxBm6TST0LeygqTjJ7yq5jYNLlS 3zNeW1rRXf+c7WTVAKZc79c= X-Received: by 2002:a17:902:6b09:: with SMTP id o9mr14206467plk.208.1543804244635; Sun, 02 Dec 2018 18:30:44 -0800 (PST) Received: from localhost ([175.223.22.143]) by smtp.gmail.com with ESMTPSA id f67sm7038883pff.29.2018.12.02.18.30.42 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 02 Dec 2018 18:30:43 -0800 (PST) Date: Mon, 3 Dec 2018 11:30:40 +0900 From: Sergey Senozhatsky To: Minchan Kim Cc: Sergey Senozhatsky , Andrew Morton , LKML , Joey Pabalinas Subject: Re: [PATCH v3 7/7] zram: writeback throttle Message-ID: <20181203023040.GA427@jagdpanzerIV> References: <20181127055429.251614-1-minchan@kernel.org> <20181127055429.251614-8-minchan@kernel.org> <20181129022358.GA6379@jagdpanzerIV> <20181202231829.GA21560@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181202231829.GA21560@google.com> User-Agent: Mutt/1.11.0 (2018-11-25) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On (12/03/18 08:18), Minchan Kim wrote: > > Per andrew's comment: > https://lkml.org/lkml/2018/11/27/156 > > I need to fix it to represent 4K always. Aha. Then we need to increase bd_writes PAGE_SIZE/4K times in writeback_store()? wb_count = atomic64_inc_return(&zram->stats.bd_writes); ... if (wb_limit != 0 && wb_count >= wb_limit) zram->stop_writeback = true; bd_wb_limit is in 4K units; but in writeback_store() we alloc a full page and write it to the backing device. So the actual number of written bytes can be larger on systems with page_size > 4K. Right? -ss