From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756698Ab2ADSUs (ORCPT ); Wed, 4 Jan 2012 13:20:48 -0500 Received: from mail-iy0-f174.google.com ([209.85.210.174]:36819 "EHLO mail-iy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752272Ab2ADSUq (ORCPT ); Wed, 4 Jan 2012 13:20:46 -0500 Date: Wed, 4 Jan 2012 10:20:41 -0800 From: Tejun Heo To: Alan Stern Cc: Kernel development list , Eric Biederman , Greg Kroah-Hartman , Kay Sievers Subject: Re: Sysfs attributes racing with unregistration Message-ID: <20120104182041.GO31746@google.com> References: <20120104171842.GN31746@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, On Wed, Jan 04, 2012 at 01:13:41PM -0500, Alan Stern wrote: > Now, looking through the code, I wonder why sysfs_{get,put}_active() > and sysfs_deactivate() don't use a real rwsem. Why go to all the > effort of imitating one? Is it just to save space? Hmmm... maybe there was something which prevented that or maybe I was just being stupid. I don't really remember. Space is a fairly important consideration too. Depending on configuration, there can be a LOT of sysfs_dirents and memory consumption from sysfs has been a real problem. Thanks. -- tejun