From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756501AbcBCINQ (ORCPT ); Wed, 3 Feb 2016 03:13:16 -0500 Received: from LGEAMRELO12.lge.com ([156.147.23.52]:53187 "EHLO lgeamrelo12.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754843AbcBCINP (ORCPT ); Wed, 3 Feb 2016 03:13:15 -0500 X-Original-SENDERIP: 156.147.1.151 X-Original-MAILFROM: byungchul.park@lge.com X-Original-SENDERIP: 10.177.222.33 X-Original-MAILFROM: byungchul.park@lge.com Date: Wed, 3 Feb 2016 17:12:42 +0900 From: Byungchul Park To: Sergey Senozhatsky Cc: 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: <20160203081242.GA32743@X58A-UD3R> References: <1454479377-24434-1-git-send-email-byungchul.park@lge.com> <20160203072847.GA32026@gmail.com> <20160203074223.GB30520@swordfish> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160203074223.GB30520@swordfish> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? > > -ss