From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753182AbdK1Bmp (ORCPT ); Mon, 27 Nov 2017 20:42:45 -0500 Received: from LGEAMRELO12.lge.com ([156.147.23.52]:54109 "EHLO lgeamrelo12.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752969AbdK1Bmo (ORCPT ); Mon, 27 Nov 2017 20:42:44 -0500 X-Original-SENDERIP: 156.147.1.125 X-Original-MAILFROM: byungchul.park@lge.com X-Original-SENDERIP: 10.177.222.33 X-Original-MAILFROM: byungchul.park@lge.com Date: Tue, 28 Nov 2017 10:42:29 +0900 From: Byungchul Park To: Petr Mladek Cc: Steven Rostedt , LKML , akpm@linux-foundation.org, linux-mm@kvack.org, Cong Wang , Dave Hansen , Johannes Weiner , Mel Gorman , Michal Hocko , Sergey Senozhatsky , Vlastimil Babka , Peter Zijlstra , Linus Torvalds , Jan Kara , Mathieu Desnoyers , Tetsuo Handa , rostedt@rostedt.homelinux.com, kernel-team@lge.com Subject: Re: [PATCH v4] printk: Add console owner and waiter logic to load balance console writes Message-ID: <20171128014229.GA2899@X58A-UD3R> References: <20171108102723.602216b1@gandalf.local.home> <20171124152857.ahnapnwmmsricunz@pathway.suse.cz> <20171124155816.pxp345ch4gevjqjm@pathway.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171124155816.pxp345ch4gevjqjm@pathway.suse.cz> 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 Fri, Nov 24, 2017 at 04:58:16PM +0100, Petr Mladek wrote: > @@ -1797,13 +1797,6 @@ asmlinkage int vprintk_emit(int facility, int level, > spin_release(&console_owner_dep_map, 1, _THIS_IP_); > printk_safe_exit_irqrestore(flags); > > - /* > - * The owner passed the console lock to us. > - * Since we did not spin on console lock, annotate > - * this as a trylock. Otherwise lockdep will > - * complain. > - */ > - mutex_acquire(&console_lock_dep_map, 0, 1, _THIS_IP_); Hello Petr, IMHO, it would get unbalanced if you only remove this mutex_acquire(). > console_unlock(); > printk_safe_enter_irqsave(flags); > } > @@ -2334,10 +2327,10 @@ void console_unlock(void) > /* The waiter is now free to continue */ > spin_release(&console_owner_dep_map, 1, _THIS_IP_); > /* > - * Hand off console_lock to waiter. The waiter will perform > - * the up(). After this, the waiter is the console_lock owner. > + * Hand off console_lock to waiter. After this, the waiter > + * is the console_lock owner. > */ > - mutex_release(&console_lock_dep_map, 1, _THIS_IP_); IMHO, this release() should be moved to somewhere properly. > + lock_commit_crosslock((struct lockdep_map *)&console_lock_dep_map); > printk_safe_exit_irqrestore(flags); > /* Note, if waiter is set, logbuf_lock is not held */ > return; However, now that cross-release was introduces, lockdep can be applied to semaphore operations. Actually, I have a plan to do that. I think it would be better to make semaphore tracked with lockdep and remove all these manual acquire() and release() here. What do you think about it? Thanks, Byungchul