Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756537Ab0BJVZB (ORCPT ); Wed, 10 Feb 2010 16:25:01 -0500 Received: from mail-fx0-f220.google.com ([209.85.220.220]:44740 "EHLO mail-fx0-f220.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751796Ab0BJVY7 (ORCPT ); Wed, 10 Feb 2010 16:24:59 -0500 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:to:cc:in-reply-to:references:content-type:date :message-id:mime-version:x-mailer:content-transfer-encoding; b=XRdqmipJeJEnlz09SCBPAN8FT+wlYOlaiwtd2bYCCnLalm46Q1EFeLyVYUptOTggVV g3cfFa+K8LxFP7CmSlEuDO9ht3wVW7ksiz7VQaTQUfAuzb9Ip+NK3yVCCLc9d0kPHy96 IafPjgb0Jk/tCA+6Opx6YzwwQYNwUKkyHCxt4= Subject: Re: [PATCH 01/17] MTD: create lockless versions of {get,put}_mtd_device This will be used to resolve deadlock in block translation layer. From: Maxim Levitsky To: Peter Zijlstra Cc: David Woodhouse , Artem Bityutskiy , linux-mtd , linux-kernel , Alex Dubov , joern , Thomas Gleixner , "stanley.miao" , Vitaly Wool In-Reply-To: <1265737574.9195.16.camel@maxim-laptop> References: <1265734665-22656-1-git-send-email-maximlevitsky@gmail.com> <1265734665-22656-2-git-send-email-maximlevitsky@gmail.com> <1265735693.11509.253.camel@laptop> <1265736206.9195.4.camel@maxim-laptop> <1265737574.9195.16.camel@maxim-laptop> Content-Type: text/plain; charset="UTF-8" Date: Wed, 10 Feb 2010 23:22:33 +0200 Message-ID: <1265836953.8276.9.camel@maxim-laptop> Mime-Version: 1.0 X-Mailer: Evolution 2.28.1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1234 Lines: 30 On Tue, 2010-02-09 at 19:46 +0200, Maxim Levitsky wrote: > On Tue, 2010-02-09 at 19:23 +0200, Maxim Levitsky wrote: > > On Tue, 2010-02-09 at 18:14 +0100, Peter Zijlstra wrote: > > > On Tue, 2010-02-09 at 18:57 +0200, Maxim Levitsky wrote: > > > > These functions can be used as long as we don't need access to global mtd table, but have > > > > a pointer to the mtd device. > > > > > > > > Signed-off-by: Maxim Levitsky > > > > --- David, I just got a great idea how to resolve the same issue in much cleaner way. Why not to drop the mtd table lock before calling the add notifers? If we assume no add_mtd_device/del_mtd_device running concurrently this should be ok. After all mtd table lock should protect only the mtd table. And the table only purpose it to locate an mtd device by number or name. This purpose will always be useful, be it a static table or not. I also remove all that mtd table junk from mtd_blktrans.c Best regards, Maxim Levitsky -- 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/