From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756647AbcBCI3S (ORCPT ); Wed, 3 Feb 2016 03:29:18 -0500 Received: from mail-pa0-f66.google.com ([209.85.220.66]:33529 "EHLO mail-pa0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756546AbcBCI3Q (ORCPT ); Wed, 3 Feb 2016 03:29:16 -0500 Date: Wed, 3 Feb 2016 17:30:30 +0900 From: Sergey Senozhatsky To: Byungchul Park Cc: Sergey Senozhatsky , Ingo Molnar , willy@linux.intel.com, akpm@linux-foundation.org, linux-kernel@vger.kernel.org, akinobu.mita@gmail.com, jack@suse.cz, peter@hurleysoftware.com, Linus Torvalds Subject: Re: [PATCH v2] lock/semaphore: Avoid an unnecessary deadlock within up() Message-ID: <20160203083030.GD30520@swordfish> References: <1454479377-24434-1-git-send-email-byungchul.park@lge.com> <20160203072847.GA32026@gmail.com> <20160203074223.GB30520@swordfish> <20160203081242.GA32743@X58A-UD3R> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160203081242.GA32743@X58A-UD3R> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On (02/03/16 17:12), Byungchul Park wrote: > On Wed, Feb 03, 2016 at 04:42:23PM +0900, Sergey Senozhatsky wrote: > > On (02/03/16 08:28), Ingo Molnar wrote: > > [..] > > > So why not move printk away from semaphores? Semaphores are classical constructs > > > that have legacies and are somewhat non-obvious to use, compared to modern, > > > simpler locking primitives. I'd not touch their implementation, unless we are > > > absolutely sure this is a safe optimization. > > > > semaphore's spin_lock is not the only spin lock that printk acquires. it also takes the > > logbuf_lock (and different locks in console drivers (up to console driver)). > > > > Jan Kara posted a patch that offloads printing job (console_trylock()-console_unlock()) > > from printk() call (when printk can offload it). so semaphore and console driver's locks > > will go away (mostly) with Jan's patch. logbug spin_lock, however, will stay. > > It sounds good. Could you teach me how to see the patch by Jan? sure, https://lkml.org/lkml/2015/10/26/16 and http://marc.info/?l=linux-kernel&m=145079206822115 -ss