Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755352AbbFBKnn (ORCPT ); Tue, 2 Jun 2015 06:43:43 -0400 Received: from mail.emea.novell.com ([130.57.118.101]:60571 "EHLO mail.emea.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753491AbbFBKnf (ORCPT ); Tue, 2 Jun 2015 06:43:35 -0400 Date: Tue, 2 Jun 2015 12:43:16 +0200 (CEST) From: Jiri Kosina X-X-Sender: jikos@twin.jikos.cz To: Jiri Bohac cc: John Stultz , lkml , Prarit Bhargava , Daniel Bristot de Oliveira , Richard Cochran , Jan Kara , Thomas Gleixner , Ingo Molnar , Shuah Khan Subject: Re: [RFC][PATCH 3/4] ntp: Use printk_deferred in leapsecond path In-Reply-To: <20150602103144.GB18714@midget.suse.cz> Message-ID: References: <1432931068-4980-1-git-send-email-john.stultz@linaro.org> <1432931068-4980-4-git-send-email-john.stultz@linaro.org> <20150602103144.GB18714@midget.suse.cz> User-Agent: Alpine 2.00 (LRH 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1292 Lines: 40 On Tue, 2 Jun 2015, Jiri Bohac wrote: > > Looking over the leapsecond code, I noticed the printk messages > > reporting the leapsecond insertion in the second_overflow path > > were not using the printk_deferred method. This was surprising > > since the printk_deferred method was added in part to avoid > > printk-ing while holding the timekeeping locks. > > > > See 6d9bcb621b0b (timekeeping: use printk_deferred when holding > > timekeeping seqlock) for further rational. > > > > I can only guess that this omission was a git add -p oversight. > > second_overflow() is called from accumulate_nsecs_to_secs(). > > accumulate_nsecs_to_secs() is called from update_wall_time() > - once directly > - once via logarithmic_accumulation() > Both calls are before write_seqcount_begin(&tk_core.seq). > > So it looks safe to use printk there. Couldn't we stuff a couple of !lockdep_is_held() assertions into printk() so that we don't have to keep rediscovering this sort of problems over and over again? Thanks, -- Jiri Kosina SUSE Labs -- 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/