Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751994Ab0AAPeD (ORCPT ); Fri, 1 Jan 2010 10:34:03 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751883Ab0AAPeB (ORCPT ); Fri, 1 Jan 2010 10:34:01 -0500 Received: from mail-ew0-f219.google.com ([209.85.219.219]:51832 "EHLO mail-ew0-f219.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751399Ab0AAPeA (ORCPT ); Fri, 1 Jan 2010 10:34:00 -0500 DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; b=hSN6F6kuzZcGiNm6tuN/LnfwzpoI8WCTAw+JjH3/TinrMJM1Zcb1OCcyKphZ0pGOok NdZd7ZGL+C85xxsVoEBDKpiB6Hje/UUfVp5BIbOR9PImc4yLETlkEUpuRZbU/L4jhiAG B7POdh0dofgR3PdcWjesCrBnW9PEIyoqWbO0k= Date: Fri, 1 Jan 2010 16:33:53 +0100 From: Borislav Petkov To: "Eric W. Biederman" Cc: Linus Torvalds , KOSAKI Motohiro , David Airlie , Linux Kernel Mailing List , Greg KH , Al Viro Subject: Re: [PATCH] sysfs: Cache the last sysfs_dirent to improve readdir scalability Message-ID: <20100101153353.GA2572@liondog.tnic> Mail-Followup-To: Borislav Petkov , "Eric W. Biederman" , Linus Torvalds , KOSAKI Motohiro , David Airlie , Linux Kernel Mailing List , Greg KH , Al Viro References: <20091226094504.GA6214@liondog.tnic> <20091228092712.AA8C.A69D9226@jp.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 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 Content-Length: 1183 Lines: 30 On Fri, Jan 01, 2010 at 05:58:00AM -0800, Eric W. Biederman wrote: > > When sysfs_readdir stops short we now cache the next sysfs_dirent to > return to user space in filp->private_data. There is no impact on the > rest of sysfs by doing this and in the common case it allows us to > pick up exactly where we left off with no seeking. > > Additionally I drop and regrab the sysfs_mutex around filldir to avoid > a page fault arbitrarily increasing the hold time on the sysfs_mutex. > > Signed-off-by: Eric W. Biederman > --- > > I haven't stressed this patch but it is sound in principle, and is a > general sysfs improvement, regardless of any locking issues. I've slapped it ontop of v2.6.33-rc2-249-gcd6e125 here and the circular locking warning is gone. I'll keep an eye on it in the next couple of days, just in case. Tested-by: Borislav Petkov -- Regards/Gruss, Boris. -- 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/