From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932446AbcECGTX (ORCPT ); Tue, 3 May 2016 02:19:23 -0400 Received: from mail-pa0-f65.google.com ([209.85.220.65]:36493 "EHLO mail-pa0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750819AbcECGTW (ORCPT ); Tue, 3 May 2016 02:19:22 -0400 From: Minchan Kim X-Google-Original-From: Minchan Kim Date: Tue, 3 May 2016 15:19:14 +0900 To: Sergey Senozhatsky Cc: Minchan Kim , Sergey Senozhatsky , Andrew Morton , linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] zram: user per-cpu compression streams Message-ID: <20160503061823.GA6062@blaptop> 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> <20160502080600.GB1811@swordfish> <20160503052324.GB17316@bbox> <20160503054011.GA5972@blaptop> <20160503055715.GC25545@swordfish> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160503055715.GC25545@swordfish> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 03, 2016 at 02:57:15PM +0900, Sergey Senozhatsky wrote: > On (05/03/16 14:40), Minchan Kim wrote: > [..] > > > At least, we need sanity check code, still? > > > Otherwise, user can echo "garbage" > /sys/xxx/max_comp_stream" and then > > > cat /sys/xxx/max_comp_stream returns num_online_cpus. > > > > One more thing, > > > > User: > > echo 4 > /sys/xxx/max_comp_stream" > > cat /sys/xxx/max_comp_streams > > 8 > > sure, it can also be > > cat /sys/xxx/max_comp_streams > 5 > cat /sys/xxx/max_comp_streams > 6 > cat /sys/xxx/max_comp_streams > 7 > cat /sys/xxx/max_comp_streams > 3 > > depending on the availability of CPUs. but why would user space > constantly check max_comp_streams? > > > which is rather weird? > > > > We should keep user's value and return it to user although it's techically > > lying. IMO, it would be best way to prevent confusing for user until we > > removes max_comp_streams finally. > > well, I preferred to show the actual state of the device. besides, > does anyone really do > > write buffer to file > if (success) > read from file and compare with the buffer > > ? > Okay, I want to go with your approach! Could you update zram.txt to reflect it? Thanks.