From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755502AbbB0WvM (ORCPT ); Fri, 27 Feb 2015 17:51:12 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:48292 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754853AbbB0WvL (ORCPT ); Fri, 27 Feb 2015 17:51:11 -0500 Date: Fri, 27 Feb 2015 14:51:09 -0800 From: Andrew Morton To: Sergey Senozhatsky Cc: Minchan Kim , Jerome Marchand , Nitin Gupta , Sergey Senozhatsky , linux-kernel@vger.kernel.org, Alan Cox Subject: Re: [PATCH 0/8] introduce dynamic device creation/removal Message-Id: <20150227145109.b5656bdf853c2d283bf9268e@linux-foundation.org> In-Reply-To: <1424959843-20409-1-git-send-email-sergey.senozhatsky@gmail.com> References: <1424959843-20409-1-git-send-email-sergey.senozhatsky@gmail.com> X-Mailer: Sylpheed 3.4.1 (GTK+ 2.24.23; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 26 Feb 2015 23:10:35 +0900 Sergey Senozhatsky wrote: > Hello, > > this patchset introduces dynamic (on demand) zram device add-remove > functionality via /dev/zram-control interface. Two ioctl commands are > defined as of now (accessible in user-space via new zram.h header file): > -- ZRAM_CTL_ADD > add new device (generates device_id automatically or uses provided > device_id) > -- ZRAM_CTL_REMOVE > remove device (by device_id) > > util-linux zramctl update will be done later, after we land this patchset. > > > This also opens a possibility to drop some of sysfs device attrs and FOO_show() > code duplication in the future, and provide device stats/info via ioctl call > instead, providing something like (via zram.h): > > struct zram_info { > __u64 orig_data_size; > __u64 mem_used_total; > __u64 max_comp_streams; > > [..] > }; > > > fill it under ->init_lock in zram_fill_info() (or any other name) function and > return all device stats at once back to user-space in a single syscall. > > This is a long term plan, of course, but I'd like to see sysfs functions go away > in a year or so. What do you think? hoo boy. Creating a /dev node and doing ioctls on it is really old school. So old school that I've forgotten why we don't do it any more. Hopefully Alan can recall the thinking?