From patchwork Mon May 5 20:47:41 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 29674 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f197.google.com (mail-vc0-f197.google.com [209.85.220.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 22361202E6 for ; Mon, 5 May 2014 20:47:59 +0000 (UTC) Received: by mail-vc0-f197.google.com with SMTP id if11sf21090919vcb.4 for ; Mon, 05 May 2014 13:47:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=Jli3X6MJVV5DDPqEZCsy1AOUPWC1luah9oOLOEG5e20=; b=A7Kmoc+7+Fm7J9zLArIrtIM0f+82fPVhC11Q7DbCbZooijVioAGWiX4KhLFZdmM5cZ nBpjrDJuEZTyDhpUJ/vpf6+5xwSrUJa6znjQVdfS1gCf0UAzf0+372meDjIWE/SjdHqV dGmCyyO9Rv8QwsnF8yZf396/S9mnkm+m4hyzjy1SwKEN+mx+YQDkoxCy4tDyFpg+05ji UU7pgEYrqOOx6IYBsrwG0r6s83WNa+7Cotd0i+nx2sLsHugxyBdzE4GoMFBUwEZfZTeG KxiVBxwD+eA40RqU3fUHzC+7/qNpcA1EUgs3H1PyWQyI1zwUZKz+MxH+JJC8oSghj5Ac 2zPQ== X-Gm-Message-State: ALoCoQkXgquGrgarDOGCHwAGu/C9dMuPHsESNkVJH7RyByXzBgJ7NAvGMcyilYwjxPDae8OZRPii X-Received: by 10.236.94.238 with SMTP id n74mr14978954yhf.27.1399322878786; Mon, 05 May 2014 13:47:58 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.102.180 with SMTP id w49ls2624139qge.3.gmail; Mon, 05 May 2014 13:47:58 -0700 (PDT) X-Received: by 10.221.64.80 with SMTP id xh16mr1736863vcb.35.1399322878672; Mon, 05 May 2014 13:47:58 -0700 (PDT) Received: from mail-ve0-f173.google.com (mail-ve0-f173.google.com [209.85.128.173]) by mx.google.com with ESMTPS id sa1si459754vdb.160.2014.05.05.13.47.58 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 05 May 2014 13:47:58 -0700 (PDT) Received-SPF: none (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) client-ip=209.85.128.173; Received: by mail-ve0-f173.google.com with SMTP id pa12so8282719veb.4 for ; Mon, 05 May 2014 13:47:58 -0700 (PDT) X-Received: by 10.58.38.40 with SMTP id d8mr1560998vek.61.1399322878608; Mon, 05 May 2014 13:47:58 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.221.72 with SMTP id ib8csp171015vcb; Mon, 5 May 2014 13:47:58 -0700 (PDT) X-Received: by 10.66.122.72 with SMTP id lq8mr76107781pab.69.1399322877803; Mon, 05 May 2014 13:47:57 -0700 (PDT) Received: from mail-pa0-f44.google.com (mail-pa0-f44.google.com [209.85.220.44]) by mx.google.com with ESMTPS id sf3si9680201pac.329.2014.05.05.13.47.56 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 05 May 2014 13:47:57 -0700 (PDT) Received-SPF: none (google.com: john.stultz@linaro.org does not designate permitted sender hosts) client-ip=209.85.220.44; Received: by mail-pa0-f44.google.com with SMTP id ld10so5110064pab.31 for ; Mon, 05 May 2014 13:47:56 -0700 (PDT) X-Received: by 10.66.102.72 with SMTP id fm8mr75884798pab.86.1399322876610; Mon, 05 May 2014 13:47:56 -0700 (PDT) Received: from localhost.localdomain (c-67-170-153-23.hsd1.or.comcast.net. [67.170.153.23]) by mx.google.com with ESMTPSA id ck10sm79423484pac.0.2014.05.05.13.47.49 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 05 May 2014 13:47:53 -0700 (PDT) From: John Stultz To: LKML Cc: John Stultz , Jan Kara , Peter Zijlstra , Jiri Bohac , Thomas Gleixner , Ingo Molnar , Andrew Morton , Steven Rostedt Subject: [PATCH 1/4] printk: Disable preemption for printk_sched Date: Mon, 5 May 2014 13:47:41 -0700 Message-Id: <1399322864-22861-2-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1399322864-22861-1-git-send-email-john.stultz@linaro.org> References: <1399322864-22861-1-git-send-email-john.stultz@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: john.stultz@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , An earlier change in -mm (printk: remove separate printk_sched buffers...), removed the printk_sched irqsave/restore lines since it was safe for current users. Since we may be expanding usage of printk_sched(), disable preepmtion for this function to make it more generally safe to call. Cc: Jan Kara Cc: Peter Zijlstra Cc: Jiri Bohac Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Andrew Morton Cc: Steven Rostedt Signed-off-by: John Stultz Reviewed-by: Jan Kara --- kernel/printk/printk.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c index 82d19e6..57467df 100644 --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c @@ -2589,12 +2589,14 @@ int printk_sched(const char *fmt, ...) va_list args; int r; + preempt_disable(); va_start(args, fmt); r = vprintk_emit(0, SCHED_MESSAGE_LOGLEVEL, NULL, 0, fmt, args); va_end(args); __this_cpu_or(printk_pending, PRINTK_PENDING_OUTPUT); irq_work_queue(&__get_cpu_var(wake_up_klogd_work)); + preempt_enable(); return r; }