Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934573AbXFFFlX (ORCPT ); Wed, 6 Jun 2007 01:41:23 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755594AbXFFFlO (ORCPT ); Wed, 6 Jun 2007 01:41:14 -0400 Received: from 74-93-104-97-Washington.hfc.comcastbusiness.net ([74.93.104.97]:47477 "EHLO sunset.davemloft.net" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1754833AbXFFFlN (ORCPT ); Wed, 6 Jun 2007 01:41:13 -0400 Date: Tue, 05 Jun 2007 22:41:28 -0700 (PDT) Message-Id: <20070605.224128.104032917.davem@davemloft.net> To: miklos@szeredi.hu Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] fix race in AF_UNIX From: David Miller In-Reply-To: References: <20070605.000247.18308209.davem@davemloft.net> <20070605.173120.59467114.davem@davemloft.net> X-Mailer: Mew version 5.1.52 on Emacs 21.4 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1060 Lines: 25 From: Miklos Szeredi Date: Wed, 06 Jun 2007 07:26:52 +0200 > > Holding a global mutex over recvmsg() calls under AF_UNIX is pretty > > much a non-starter, this will kill performance for multi-threaded > > apps. > > That's an rwsem held for read. It's held for write in unix_gc() only > for a short duration, and unix_gc() should only rarely be called. So > I don't think there's any performance problem here. It pulls a non-local cacheline into the local thread, that's extremely expensive on SMP. If everyone starts grabbing this thing during recvmsg() it's going to become a really hot lock and kill performance, even if it's a read side lock being taken. That's why I said we need to investigate solutions involving u->readlock, that already has to be taken and is local to the socket. - 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/