From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932547AbcECCUu (ORCPT ); Mon, 2 May 2016 22:20:50 -0400 Received: from LGEAMRELO11.lge.com ([156.147.23.51]:59029 "EHLO lgeamrelo11.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932252AbcECCUt (ORCPT ); Mon, 2 May 2016 22:20:49 -0400 X-Original-SENDERIP: 156.147.1.121 X-Original-MAILFROM: minchan@kernel.org X-Original-SENDERIP: 10.177.223.161 X-Original-MAILFROM: minchan@kernel.org Date: Tue, 3 May 2016 11:20:46 +0900 From: Minchan Kim To: Sergey Senozhatsky Cc: Sergey Senozhatsky , Andrew Morton , linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] zram: user per-cpu compression streams Message-ID: <20160503022046.GB3642@bbox> References: <1461860230-849-1-git-send-email-sergey.senozhatsky@gmail.com> <1461860230-849-3-git-send-email-sergey.senozhatsky@gmail.com> <20160502062311.GB6077@bbox> <20160502072508.GA1811@swordfish> <20160502082822.GC6077@bbox> <20160502092157.GA21764@swordfish> <20160503014018.GB2272@bbox> <20160503015333.GA9987@swordfish> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160503015333.GA9987@swordfish> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Sergey! On Tue, May 03, 2016 at 10:53:33AM +0900, Sergey Senozhatsky wrote: > Hello Minchan, > > On (05/03/16 10:40), Minchan Kim wrote: > > > > > > ...hm... inc ->failed_writes? > [..] > > Okay, let's add the knob to the existing sysfs(There is no different > > between sysfs and debugfs with point of userspace once they start to > > use it) because no need to add new code to avoid such mess. > > > > Any thoughts? > > so you don't want to account failed fast-path writes in failed_writes? Yes, I think we cannot reuse the field. > it sort of kind of fits, to some extent. re-compression is, basically, > a new write operation -- allocate handle, map the page again, compress, > etc., etc. so in a sense failed fast-path write is _almost_ a failed write, > except that we took extra care of handling it and retried the op inside > of zram, not from bio or fs layer. Maybe, I don't understand you but my point is simple. Documentation/ABI/testing/sysfs-block-zram says What: /sys/block/zram/failed_writes Date: February 2014 Contact: Sergey Senozhatsky Description: The failed_writes file is read-only and specifies the number of failed writes happened on this device. If user read it, they will think failed_writes means write-error on the device. As well, it's true until now. :) If we piggy back on that to represent duplicate compression, users will start to see the increased count and they wonder "Hmm, fs or swap on zram might be corrupted" and don't use zram any more. Otherwise, they will report it to us. :) We should explain to them "Hey, it's not failed write but just duplicated I/O blah blah. Please read document and we already corrected the wording in the document to represent current status." which would be painful both users and us. Rather than piggy backing on failed_writes, actually I want to remove failed_[read|write] which is no point stat, I think. We are concerning about returing back to no per-cpu options but actually, I don't want. If duplicate compression is really problem(But It's really unlikely), we should try to solve the problem itself with different way rather than roll-back to old, first of all. I hope we can. So let's not add big worry about adding new dup stat. :)