Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp156620imu; Mon, 26 Nov 2018 18:41:28 -0800 (PST) X-Google-Smtp-Source: AFSGD/XuGr82cy3M9tMtqERKAG6gmSw6cD5Z/53l5Uoj/24+GXdtHUU6xNzPg0HD00PspJrfaaSc X-Received: by 2002:a62:3241:: with SMTP id y62mr4135024pfy.178.1543286488466; Mon, 26 Nov 2018 18:41:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543286488; cv=none; d=google.com; s=arc-20160816; b=Ywf2zN1w0mgveYmh5HHMNSur0xr+0VEnbt1PEteXW6LiEt6D06CVuDgdKLN2UWBynj j/DCCWdTZA1ZKuSC3cJs4NSC/56sNlMwORGC0YYj5lQwaGVIKjqEBoqCEwsaP7eyX72L ocuLXa0oPQ+UuCB5fA/N6G6/86SpmPjwCtgFJbvxJtuDtIi0JrDoBR5GXdwZTo+NGOE9 f2GKRgsxz9TjNIqSVOcrjBThL7EIbPW3gccEFDwxGn7jcP3CUKKxBIDLejZtu9yL7d5o rjdku6moAwisf8XBnQIH6c+L+7b0ammhxh/Zi4OT4Z7EHflyYBAd1iXhBC19QAJRYH/N tfnw== 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=As1qRHlSzGV0HQiwzdFbfPRf16QGYU3mLf/xOPgRwv8=; b=cI6BA1l12wQFzkNE1b5FAgLZsHBDr75StUbaOkkqkHNk+foruXlTItpPS1exlFB8tT vQl/dZT+CwPG51kk35XQDdnx40tVeeYksGG0Z4Kj1d08UwkyIJCUFqiRDEQAkcKwDN2G LNdzDxE5pO4HdeGLfLL1cuclbk1vbRsR+Y6lCOosCz/RuURk5sUEbW8r9is2Xxe29DNB dTeBbZTuHCW7P9KX5d6BibGSJEW9iWAjyU1ZK7mFakojzSL3aypP4KN3FJWH6ylfOr82 OVrXfPJFnxtu5vnaXnJlZvgTuUDpAEy63NJeOKKvbY7ifHEK48Yuhap0sgtgR6I8xvo7 hOaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=Adf12+kh; 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 c17si2543119pfb.81.2018.11.26.18.41.12; Mon, 26 Nov 2018 18:41:28 -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=fail header.i=@gmail.com header.s=20161025 header.b=Adf12+kh; 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 S1728134AbeK0NEu (ORCPT + 99 others); Tue, 27 Nov 2018 08:04:50 -0500 Received: from mail-pl1-f193.google.com ([209.85.214.193]:36201 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726535AbeK0NEu (ORCPT ); Tue, 27 Nov 2018 08:04:50 -0500 Received: by mail-pl1-f193.google.com with SMTP id g9so2327639plo.3 for ; Mon, 26 Nov 2018 18:08:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=As1qRHlSzGV0HQiwzdFbfPRf16QGYU3mLf/xOPgRwv8=; b=Adf12+khdK2B0O3mDBuvCeTM4JtMinOSB2sdSRwo6CjBCzG8n3JjiD2ECsG0himTix l1ZJIfblD4yBBO/leN9L6dZhvngWRwZbMzjMo/Ajf9Wy+N8+PwkWJu6s0jowcXL2Ot11 /PDpVQaUl9HWh4DW2iVJr2tGPnSWbtCPopga3Qs9l3U9B4g44sUfgWPKwE/0WUiV8hGs RyTG41QliEX7HouPfvSNfSx+CL358obvGvb4N81YXf1CODDNwnaS4ouGjOXinZLh/rrG 4oZcWTZFdzdcGFs2x4IeDlP5pqmlGfzeeCh1RDl3gx02WEDh0JOXnhNWV5SW3x3A3k4w hbBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=As1qRHlSzGV0HQiwzdFbfPRf16QGYU3mLf/xOPgRwv8=; b=gwzblsgXxrBrocfhwZQI54Va8gdz0b20TGUmlyp9aGnOxBcHo17GQrUCgD2HhZqghf y6wGkUEm8Nf8JD74nUKD3xj76ZqsXZcRNok5oFlFBIs8pczSzAfRS9bM4M/+MdVZ/xrw 634Zo/VY8agdiP9eguD8Wgm7TCba7/4KHQfryDbU60VgH8W2oaMhyNrsKqK6UCbtJEX5 vEczO0jJmjWNZ2uBFZW7eV8ro4XOH2zNbao/gSASiU0PqMGGQWTW1AY7kIDk1TUeN+Lz waD5pYacOEAAD6ZdB9YAzwLdBpSnJD316Gw4GjBNMCV3TpvFZfbgGUO++ZoqpVTcnNSn xBDA== X-Gm-Message-State: AA+aEWZ95zqarjPiB0L3m6W5GYz0iWdwYEncwgjGoQNTQ8hXS1qMglQJ /Y5v6ykB5HNbHUKweNX8w+6wExVmSp0= X-Received: by 2002:a17:902:2cc1:: with SMTP id n59-v6mr30770703plb.26.1543284516694; Mon, 26 Nov 2018 18:08:36 -0800 (PST) Received: from google.com ([2401:fa00:d:0:98f1:8b3d:1f37:3e8]) by smtp.gmail.com with ESMTPSA id 85sm2258675pfw.17.2018.11.26.18.08.34 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 26 Nov 2018 18:08:35 -0800 (PST) Date: Tue, 27 Nov 2018 11:08:32 +0900 From: Minchan Kim To: Andrew Morton Cc: LKML , Sergey Senozhatsky Subject: Re: [PATCH v2 7/7] zram: writeback throttle Message-ID: <20181127020832.GC237537@google.com> References: <20181126082813.81977-1-minchan@kernel.org> <20181126082813.81977-8-minchan@kernel.org> <20181126125446.562aca37cc7c0dd8456c3a25@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181126125446.562aca37cc7c0dd8456c3a25@linux-foundation.org> User-Agent: Mutt/1.10.1+60 (6df12dc1) (2018-08-07) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 26, 2018 at 12:54:46PM -0800, Andrew Morton wrote: > On Mon, 26 Nov 2018 17:28:13 +0900 Minchan Kim wrote: > > > On small memory system, there are lots of write IO so if we use > > flash device as swap, there would be serious flash wearout. > > To overcome the problem, system developers need to design write > > limitation strategy to guarantee flash health for entire product life. > > > > This patch creates a new konb "writeback_limit" on zram. With that, > > if current writeback IO count(/sys/block/zramX/io_stat) excceds > > the limitation, zram stops further writeback until admin can reset > > the limit. > > > > +++ b/Documentation/ABI/testing/sysfs-block-zram > > @@ -121,3 +121,12 @@ Contact: Minchan Kim > > The bd_stat file is read-only and represents backing device's > > statistics (bd_count, bd_reads, bd_writes) in a format > > similar to block layer statistics file format. > > + > > +What: /sys/block/zram/writeback_limit > > +Date: November 2018 > > +Contact: Minchan Kim > > +Description: > > + The writeback_limit file is read-write and specifies the maximum > > + amount of writeback ZRAM can do. The limit could be changed > > + in run time and "0" means disable the limit. > > + No limit is the initial state. > > diff --git a/Documentation/blockdev/zram.txt b/Documentation/blockdev/zram.txt > > index 550bca77d322..41748d52712d 100644 > > --- a/Documentation/blockdev/zram.txt > > +++ b/Documentation/blockdev/zram.txt > > @@ -164,6 +164,8 @@ reset WO trigger device reset > > mem_used_max WO reset the `mem_used_max' counter (see later) > > mem_limit WO specifies the maximum amount of memory ZRAM can use > > to store the compressed data > > +writeback_limit WO specifies the maximum amount of write IO zram can > > + write out to backing device > > Neither the changelog nor the Documentation specify the units of > writeback_limit. Bytes? Pages? Blocks? > > This gets so confusing that in many /proc/sys/vm files we actually put > the units into the filenames. > I will use unit as 4K. Thanks.