Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760518Ab0KRVCm (ORCPT ); Thu, 18 Nov 2010 16:02:42 -0500 Received: from mail-ey0-f174.google.com ([209.85.215.174]:44039 "EHLO mail-ey0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757846Ab0KRVCj (ORCPT ); Thu, 18 Nov 2010 16:02:39 -0500 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=KJwQJm7YgcsvYird9+zYqkhdji8um0e6xh/oa2NXRM6f/AsX0rlEkqmtGdPYSHv5B/ pwg36BbpSDz1pLvxETXj5qhAdd32+UIw4Y/PCkZT5hwdcrxAnLYs0kZWbLvG+8q3FGGQ FD2oVyQx024295YP6ALOeNjMZydVVfBm333+k= Message-ID: <4CE59482.3050002@gmail.com> Date: Fri, 19 Nov 2010 00:02:58 +0300 From: Vladislav Bolkhovitin User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.10) Gecko/20100527 Thunderbird/3.0.5 MIME-Version: 1.0 To: Greg KH CC: Richard Williams , Bart Van Assche , Boaz Harrosh , FUJITA Tomonori , Mike Christie , "linux-scsi@vger.kernel.org" , Dmitry Torokhov , "linux-kernel@vger.kernel.org" , James Bottomley , scst-devel , Hannes Reinecke , Andy Yan , Andrew Morton , Vu Pham , Linus Torvalds , Joel Becker Subject: Re: [Scst-devel] [PATCH 8/19]: SCST SYSFS interface implementation References: <20101109002829.GA22633@kroah.com> <4CD9A9B8.70708@vlnb.net> <4CDA6CD4.3010308@panasas.com> <4CDAFE6E.7050200@vlnb.net> <4CDBBE80.40908@panasas.com> <4CDC56F9.9040601@vlnb.net> <20101112012315.GE17097@core.coreip.homeip.net> <4CDEC8D2.8080101@vlnb.net> <20101113235938.GA1827@kroah.com> <4CE1017E.4090409@panasas.com> <20101115161620.GB5981@kroah.com> <4CE16B8E.1000300@panasas.com> <8985DEAF-4227-4629-B90A-938D2BA3534E@etechsoft.com> <4CE2846C.6070501@vlnb.net> In-Reply-To: <4CE2846C.6070501@vlnb.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 12624 Lines: 350 Vladislav Bolkhovitin, on 11/16/2010 04:17 PM wrote: > Your questions are very good, so let's summarize what we need to serve > the needs of a SCSI target subsystem (not necessary SCST) and see what > can fit them. > > So, the needs: > > 1. Be capable to represent to user space internal configuration to let > user space be able to see and analyze it, including various statistics. > > 2. Let user space manage the internal configuration. > > 3. Desired: possibility to send to user space events about important > internal actions, like I/O failures, which may need user space > intervention to recover, like switching from active to passive role in a > cluster. > > So, what can we do with ConfigFS: > > (1): Only partially, because by design ConfigFS isn't supposed to > represent internal configuration, it can only manage it. Extending > ConfigFS to be capable to do that would be, in my understanding, a > strong violation of its purpose and, hence, design and if went this way > eventually ConfigFS would become just a duplication of the SYSFS > functionality. > > (2): ConfigFS can do that. This is exactly for what it was designed and > implemented. But in this particular application it would have some > limitations derived from (1): to manage harware-related entries a user > should magically know from somewhen names of those entries to create > them by "mkdir" command. > > For instance, consider a user has a Fibre Channel HBA and want to use it > in the target mode. Before he can configure it, he should somehow know > its ports names and for each of them run: > > # mkdir /sys/kernel/config/.../50:50:00:00:00:00:00:11 > # mkdir /sys/kernel/config/.../50:50:00:00:00:00:00:12 > ... > > where 50:50:00:00:00:00:00:1x are the ports' names. Only after that > those ports appear on the ConfigFS and can be managed. > > (3): No events at all. > > Now consider SYSFS: > > (1): Easily. This is exactly for what it was designed and implemented. > > (2): Possible without any limitations and side effects. > > (3): Also possible. > > So, why not use SYSFS if it suits all the needs _without_ any additional > effort and patches? > > Other alternatives? A set of custom IOCTLs? One more configuration FS? I > believe, those would be quite disgusting for all. > >> Maybe I misunderstand - But if both sides have merit then wouldn't a >> compromise be appropriate? >> >> Maybe the sensical compromise is to use sysfs code to create a new >> namespace that would fit this purpose? It seems that I am also >> hearing that the alternatives to sysfs aren't always adequate - so >> why not use sysfs, but have a place where it's appropriate to use it? > > This is exactly what we are proposing: to use SYSFS in additional > namespace /sys/kernel/scst_tgt. > > As far as I can see, only Greg is against it. Greg keeps his reasons > private, so I can only guess that Greg is against extending usage of > SYSFS (note, _usage_, not implementation! Everything needed long ago > implemented.) beyond the scope it was originally designed around 10 > years ago. But SYSFS is already widely used this way in the kernel, as > Joe illustrated, hence there is demand for it. People need it. So, why > not to just acknowledge this fact and go ahead the simplest and most > useful for both users and developers way? Since nobody objected, Greg, could you consider to ACK SCST SYSFS management interface in /sys/kernel/scst_tgt/, please? Please find the SCST SYSFS ABI documentation file you requested below. We are also preparing a new patch to free our objects in kobjects.release() without explicit x_initialized flags as you requested. Thank you for your effort, Vlad Documentation/ABI/testing/sysfs-scst: What: /sys/kernel/scst_tgt/ Date: November 2010 Contact: Vladislav Bolkhovitin Description: Contains SCST management interface entries. What: /sys/kernel/scst_tgt/devices/ Date: November 2010 Contact: Vladislav Bolkhovitin Description: Contains subdirectories for all SCST devices What: /sys/kernel/scst_tgt/devices//exported/exportX Date: November 2010 Contact: Vladislav Bolkhovitin Description: Links to LUNs in the LUNs group where exported, e.g. to /sys/kernel/scst_tgt/targets/iscsi/iqn.2006-10.net.vlnb:tgt/luns/11 What: /sys/kernel/scst_tgt/devices//handler Date: November 2010 Contact: Vladislav Bolkhovitin Description: Link to dev handler of this device, if assigned, e.g. to /sys/kernel/scst_tgt/handlers/dev_disk What: /sys/kernel/scst_tgt/devices//type Date: November 2010 Contact: Vladislav Bolkhovitin Description: SCSI type of this device as define by SAM. What: /sys/kernel/scst_tgt/handlers/ Date: November 2010 Contact: Vladislav Bolkhovitin Description: Contains all SCST dev handlers. What: /sys/kernel/scst_tgt/handlers// Date: November 2010 Contact: Vladislav Bolkhovitin Description: Links to managed by this dev handler, e.g. ext3_disk1_4K -> /sys/kernel/scst_tgt/devices/ext3_disk1_4K What: /sys/kernel/scst_tgt/handlers//mgmt Date: November 2010 Contact: Vladislav Bolkhovitin Description: Management entry, which allows to create and delete devices for this dev handler. See SysfsRules file for more info. What: /sys/kernel/scst_tgt/handlers//type Date: November 2010 Contact: Vladislav Bolkhovitin Description: SCSI type of this dev handler as define by SAM. What: /sys/kernel/scst_tgt/sgv/ Date: November 2010 Contact: Vladislav Bolkhovitin Description: Contains SCST SGV caches statistics. What: /sys/kernel/scst_tgt/sgv/global_stats Date: November 2010 Contact: Vladislav Bolkhovitin Description: Contains global SGV cache statistics. What: /sys/kernel/scst_tgt/sgv//stats Date: November 2010 Contact: Vladislav Bolkhovitin Description: Contains statistics for SGV cache What: /sys/kernel/scst_tgt/targets/ Date: November 2010 Contact: Vladislav Bolkhovitin Description: Contains all SCST target drivers What: /sys/kernel/scst_tgt/targets/ Date: November 2010 Contact: Vladislav Bolkhovitin Description: Contains all targets for What: /sys/kernel/scst_tgt/targets//mgmt Date: November 2010 Contact: Vladislav Bolkhovitin Description: Optional management entry, which allows to create and delete targets for this target driver. See SysfsRules file for more info. What: /sys/kernel/scst_tgt/targets//enable Date: November 2010 Contact: Vladislav Bolkhovitin Description: Optional attribute to enable and make it serve incoming connections from initiators. Possible values: 1 - enable 0 - disable What: /sys/kernel/scst_tgt/targets///ini_groups/ Date: November 2010 Contact: Vladislav Bolkhovitin Description: Contains security groups for What: /sys/kernel/scst_tgt/targets///ini_groups/mgmt Date: November 2010 Contact: Vladislav Bolkhovitin Description: Allows to create and delete security groups for . See README.scst for more info. What: /sys/kernel/scst_tgt/targets///ini_groups//initiators/mgmt Date: November 2010 Contact: Vladislav Bolkhovitin Description: Allows to add and delete initiators to/from . See README.scst for more info. What: /sys/kernel/scst_tgt/targets///ini_groups//initiators/ Date: November 2010 Contact: Vladislav Bolkhovitin Description: One or more initiators in . Contains initiator's name. What: /sys/kernel/scst_tgt/targets///ini_groups//luns/mgmt Date: November 2010 Contact: Vladislav Bolkhovitin Description: Allows to add and delete LUNs to/from . See README.scst for more info. What: /sys/kernel/scst_tgt/targets///ini_groups//luns//device Date: November 2010 Contact: Vladislav Bolkhovitin Description: Link to device for , e.g. to /sys/kernel/scst_tgt/devices/ext3_disk1_4K What: /sys/kernel/scst_tgt/targets///ini_groups//luns//read_only Date: November 2010 Contact: Vladislav Bolkhovitin Description: Sets if this LUN should be read only What: /sys/kernel/scst_tgt/targets///ini_groups//addr_method Date: November 2010 Contact: Vladislav Bolkhovitin Description: Sets SCSI addressing method for . See README.scst for more info. What: /sys/kernel/scst_tgt/targets///ini_groups//cpu_mask Date: November 2010 Contact: Vladislav Bolkhovitin Description: Sets CPU mask for threads serving initiators in . See README.scst for more info. What: /sys/kernel/scst_tgt/targets///ini_groups//io_grouping_type Date: November 2010 Contact: Vladislav Bolkhovitin Description: Sets IO grouping types for threads serving initiators in . See README.scst for more info. What: /sys/kernel/scst_tgt/targets///luns/mgmt Date: November 2010 Contact: Vladislav Bolkhovitin Description: Allows to add and delete LUNs to/from the 's default set of LUNs. See README.scst for more info. What: /sys/kernel/scst_tgt/targets///luns//device Date: November 2010 Contact: Vladislav Bolkhovitin Description: Link to device for , e.g. to /sys/kernel/scst_tgt/devices/ext3_disk1_4K What: /sys/kernel/scst_tgt/targets///luns//read_only Date: November 2010 Contact: Vladislav Bolkhovitin Description: Sets if this LUN should be read only What: /sys/kernel/scst_tgt/targets///addr_method Date: November 2010 Contact: Vladislav Bolkhovitin Description: Sets SCSI addressing method for the 's default set of LUNs. See README.scst for more info. What: /sys/kernel/scst_tgt/targets///cpu_mask Date: November 2010 Contact: Vladislav Bolkhovitin Description: Sets CPU mask for threads serving initiators in the 's default set of LUNs. See README.scst for more info. What: /sys/kernel/scst_tgt/targets///io_grouping_type Date: November 2010 Contact: Vladislav Bolkhovitin Description: Sets IO grouping types for threads serving initiators in the 's default set of LUNs. See README.scst for more info. What: /sys/kernel/scst_tgt/targets///enable Date: November 2010 Contact: Vladislav Bolkhovitin Description: Optional attribute to enable and make it serve incoming connections from initiators. Possible values: 1 - enable 0 - disable What: /sys/kernel/scst_tgt/last_sysfs_mgmt_res Date: November 2010 Contact: Vladislav Bolkhovitin Description: Returning completion status of the last management command. See README.scst for more info. What: /sys/kernel/scst_tgt/setup_id Date: November 2010 Contact: Vladislav Bolkhovitin Description: Allows to read and write SCST setup ID. This ID can be used in cases, when the same SCST configuration should be installed on several targets, but exported from those targets devices should have different IDs and SNs. For instance, VDISK dev handler uses this ID to generate T10 vendor specific identifier and SN of the devices. What: /sys/kernel/scst_tgt/threads Date: November 2010 Contact: Vladislav Bolkhovitin Description: Allows to read and set number of global SCST I/O threads. Those threads used with async. dev handlers, for instance, vdisk BLOCKIO or NULLIO What: /sys/kernel/scst_tgt/version Date: November 2010 Contact: Vladislav Bolkhovitin Description: Allows to see version of SCST and enabled optional features. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/