All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: "K.R. Foley" <kr@cybsft.com>
Cc: linux-kernel@vger.kernel.org, Lee Revell <rlrevell@joe-job.com>,
	Mark_H_Johnson@Raytheon.com
Subject: Re: BKL backtraces - was: Re: [patch] voluntary-preempt-2.6.9-rc2-mm1-S1
Date: Tue, 21 Sep 2004 09:18:54 +0200	[thread overview]
Message-ID: <20040921071854.GA7604@elte.hu> (raw)
In-Reply-To: <414F8CFB.3030901@cybsft.com>

[-- Attachment #1: Type: text/plain, Size: 1569 bytes --]


* K.R. Foley <kr@cybsft.com> wrote:

> All of these were generated while booting:
> 
> Sep 20 19:45:10 porky kernel: using smp_processor_id() in preemptible 
> code: modprobe/1019
> Sep 20 19:45:10 porky kernel:  [<c011c58e>] smp_processor_id+0x8e/0xa0
> Sep 20 19:45:10 porky kernel:  [<c013ace6>] module_unload_init+0x46/0x70
> Sep 20 19:45:10 porky kernel:  [<c013ce58>] load_module+0x598/0xb10
> Sep 20 19:45:10 porky kernel:  [<c013d438>] sys_init_module+0x68/0x280
> Sep 20 19:45:10 porky kernel:  [<c01066b9>] sysenter_past_esp+0x52/0x71
> 
> The above one of course repeats on each module load.

ok, this is a harmless false positive - the attached patch fixes it.

> Sep 20 19:45:10 porky kernel: using smp_processor_id() in preemptible 
> code: X/1017
> Sep 20 19:45:10 porky kernel:  [<c011c58e>] smp_processor_id+0x8e/0xa0
> Sep 20 19:45:10 porky kernel:  [<c01d6c15>] add_timer_randomness+0x125/0x150
> Sep 20 19:45:10 porky kernel:  [<c01d6c9e>] add_mouse_randomness+0x1e/0x30
> Sep 20 19:45:10 porky kernel:  [<c022b835>] input_event+0x55/0x3f0

> Sep 20 19:45:10 porky kernel:  [<c01e1390>] vt_ioctl+0x0/0x1ad0
> Sep 20 19:45:10 porky kernel:  [<c01dc08b>] tty_ioctl+0x37b/0x4d0
> Sep 20 19:45:10 porky kernel:  [<c0175034>] sys_ioctl+0xe4/0x240
> Sep 20 19:45:10 porky kernel:  [<c01066b9>] sysenter_past_esp+0x52/0x71
> 
> The X one above repeats once also.

aha! This is a real one, fixed by the second patch. This piece of code
relied on add_timer_randomness() always being called with preemption
disabled.

these fixes will show up in -S2.

	Ingo

[-- Attachment #2: 1 --]
[-- Type: text/plain, Size: 441 bytes --]

--- linux/kernel/module.c.orig	
+++ linux/kernel/module.c	
@@ -394,7 +394,7 @@ static void module_unload_init(struct mo
 	for (i = 0; i < NR_CPUS; i++)
 		local_set(&mod->ref[i].count, 0);
 	/* Hold reference count during initialization. */
-	local_set(&mod->ref[smp_processor_id()].count, 1);
+	local_set(&mod->ref[_smp_processor_id()].count, 1);
 	/* Backwards compatibility macros put refcount during init. */
 	mod->waiter = current;
 }

[-- Attachment #3: 2 --]
[-- Type: text/plain, Size: 698 bytes --]

--- linux/drivers/char/random.c.orig	
+++ linux/drivers/char/random.c	
@@ -807,10 +807,11 @@ static void add_timer_randomness(struct 
 	long		delta, delta2, delta3;
 	int		entropy = 0;
 
+	preempt_disable();
 	/* if over the trickle threshold, use only 1 in 4096 samples */
 	if ( random_state->entropy_count > trickle_thresh &&
 	     (__get_cpu_var(trickle_count)++ & 0xfff))
-		return;
+		goto out;
 
 	/*
 	 * Use get_cycles() if implemented, otherwise fall back to
@@ -861,6 +862,8 @@ static void add_timer_randomness(struct 
 		entropy = int_ln_12bits(delta);
 	}
 	batch_entropy_store(num, time, entropy);
+out:
+	preempt_enable();
 }
 
 void add_keyboard_randomness(unsigned char scancode)

  reply	other threads:[~2004-09-21  7:17 UTC|newest]

Thread overview: 223+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20040903120957.00665413@mango.fruits.de>
     [not found] ` <20040903100946.GA22819@elte.hu>
     [not found]   ` <20040903123139.565c806b@mango.fruits.de>
2004-09-03 10:32     ` lockup with voluntary preempt R0 and VP, KP, etc, disabled Ingo Molnar
2004-09-03 11:59       ` Florian Schmidt
2004-09-03 11:55         ` Ingo Molnar
2004-09-03 13:01           ` Florian Schmidt
2004-09-03 12:04         ` Florian Schmidt
2004-09-03 12:08           ` Florian Schmidt
2004-09-03 18:28             ` Lee Revell
2004-09-03 18:54               ` Florian Schmidt
2004-09-03 18:52                 ` Lee Revell
2004-09-03 19:06                 ` K.R. Foley
2004-09-04 19:51 ` [patch] voluntary-preempt-2.6.9-rc1-bk4-R4 Ingo Molnar
2004-09-05 14:02   ` [patch] voluntary-preempt-2.6.9-rc1-bk12-R5 Ingo Molnar
2004-09-05 16:07     ` Matt Heler
2004-09-05 18:16     ` Lee Revell
2004-09-05 19:12       ` Ingo Molnar
2004-09-05 21:03         ` Lee Revell
2004-09-06  6:30           ` Ingo Molnar
2004-09-06  7:44             ` Lee Revell
2004-09-07  3:17               ` K.R. Foley
2004-09-06 11:06     ` [patch] voluntary-preempt-2.6.9-rc1-bk12-R6 Ingo Molnar
2004-09-06 11:48       ` Rafael J. Wysocki
2004-09-06 12:25         ` Alexander Nyberg
2004-09-06 12:29           ` Ingo Molnar
2004-09-07  9:26             ` [patch] voluntary-preempt-2.6.9-rc1-bk12-R7 Ingo Molnar
2004-09-07 11:57               ` [patch] voluntary-preempt-2.6.9-rc1-bk12-R8 Ingo Molnar
2004-09-07 14:50                 ` Alexander Nyberg
2004-09-07 15:04                   ` Ingo Molnar
2004-09-07 15:29                     ` Alexander Nyberg
2004-09-07 19:56                 ` Rafael J. Wysocki
2004-09-07 22:59                 ` Lee Revell
2004-09-08  8:20                   ` [patch] voluntary-preempt-2.6.9-rc1-bk12-R9 Ingo Molnar
2004-09-08  9:46                     ` Rafael J. Wysocki
2004-09-08  9:56                       ` Ingo Molnar
2004-09-08 22:37                     ` Lee Revell
2004-09-09  6:17                       ` [patch] voluntary-preempt-2.6.9-rc1-bk12-S0 Ingo Molnar
2004-09-09 19:30                         ` Lee Revell
2004-09-09 20:23                           ` Lee Revell
2004-09-19 12:26                         ` [patch] voluntary-preempt-2.6.9-rc2-mm1-S1 Ingo Molnar
2004-09-19 17:05                           ` Felipe Alfaro Solana
2004-09-20 17:14                           ` K.R. Foley
2004-09-20 19:48                             ` Ingo Molnar
2004-09-21  2:25                               ` K.R. Foley
2004-09-20 19:47                           ` Magnus Määttä
2004-09-21  2:07                           ` BKL backtraces - was: " K.R. Foley
2004-09-21  7:18                             ` Ingo Molnar [this message]
2004-09-21  7:44                               ` [patch] voluntary-preempt-2.6.9-rc2-mm1-S2 Ingo Molnar
2004-09-21 18:51                                 ` K.R. Foley
2004-09-22 10:33                                 ` [patch] voluntary-preempt-2.6.9-rc2-mm1-S3 Ingo Molnar
2004-09-22 15:07                                   ` K.R. Foley
2004-09-22 17:16                                     ` Lee Revell
2004-09-22 17:40                                       ` K.R. Foley
2004-09-22 19:45                                       ` Ingo Molnar
2004-09-22 17:09                                   ` K.R. Foley
2004-09-22 19:08                                   ` Lee Revell
2004-09-23  1:13                                   ` Lee Revell
2004-09-23 12:28                                   ` [patch] voluntary-preempt-2.6.9-rc2-mm1-S4 Ingo Molnar
2004-09-23 12:57                                     ` Norberto Bensa
2004-09-23 13:01                                       ` Ingo Molnar
2004-09-23 13:07                                         ` Ingo Molnar
2004-09-23 13:09                                         ` Ingo Molnar
2004-09-23 16:46                                           ` Norberto Bensa
2004-09-23 17:13                                             ` Norberto Bensa
2004-09-23 18:20                                               ` Ingo Molnar
2004-09-23 13:35                                     ` Rui Nuno Capela
2004-09-23 13:40                                       ` Ingo Molnar
2004-09-23 16:23                                         ` Rui Nuno Capela
2004-09-23 18:07                                           ` Rui Nuno Capela
2004-09-24 12:43                                             ` OHCI_QUIRK_INITRESET (was: 2.6.9-rc2-mm2 ohci_hcd doesn't work) Rui Nuno Capela
2004-09-24 12:55                                               ` Ingo Molnar
2004-09-24 14:00                                                 ` Rui Nuno Capela
2004-09-24 16:16                                                   ` Bjorn Helgaas
2004-09-25 23:37                                                     ` David Brownell
2004-09-26 13:09                                                       ` Rui Nuno Capela
2004-09-27 15:11                                                       ` Bjorn Helgaas
2004-09-23 21:12                                     ` [patch] voluntary-preempt-2.6.9-rc2-mm3-S5 Ingo Molnar
2004-09-24  0:32                                       ` Rui Nuno Capela
2004-09-24  2:22                                       ` K.R. Foley
2004-09-24  3:30                                         ` K.R. Foley
2004-09-24  7:40                                           ` Ingo Molnar
2004-09-24 11:05                                             ` K.R. Foley
2004-09-24 11:45                                               ` Ingo Molnar
2004-09-24  7:44                                       ` [patch] voluntary-preempt-2.6.9-rc2-mm3-S6 Ingo Molnar
2004-09-28  0:05                                         ` [patch] voluntary-preempt-2.6.9-rc2-mm4-S7 Ingo Molnar
2004-09-28 20:17                                           ` Rui Nuno Capela
2004-09-28 21:03                                             ` Rui Nuno Capela
2004-09-28 21:46                                               ` Rui Nuno Capela
2004-09-28 22:01                                                 ` Matt Heler
2004-09-29 17:43                                           ` Lee Revell
2004-09-29 18:40                                           ` Lee Revell
2004-09-29 20:30                                             ` Ingo Molnar
2004-09-29 20:34                                               ` Lee Revell
2004-10-02  3:02                                           ` Lee Revell
2004-10-02  9:50                                             ` Ingo Molnar
2004-10-03  2:01                                           ` Lee Revell
2004-10-03  2:14                                             ` Lee Revell
2004-10-03  2:19                                               ` Lee Revell
2004-10-03 20:08                                             ` Ingo Molnar
2004-10-03  6:37                                           ` Lee Revell
2004-10-03  6:50                                             ` Lee Revell
2004-10-03  7:06                                               ` Lee Revell
2004-10-03 19:57                                                 ` Ingo Molnar
2004-10-04  0:53                                                   ` Lee Revell
2004-10-04 10:17                                                     ` Ingo Molnar
2004-10-04 17:20                                                       ` Lee Revell
2004-10-03 20:05                                             ` Ingo Molnar
2004-10-03 21:09                                           ` [patch] voluntary-preempt-2.6.9-rc3-mm1-S8 Ingo Molnar
2004-10-04 21:53                                             ` [patch] voluntary-preempt-2.6.9-rc3-mm1-S9 Ingo Molnar
2004-10-05  0:31                                               ` Lee Revell
2004-10-05  0:56                                                 ` Florian Schmidt
2004-10-05  0:45                                                   ` Lee Revell
2004-10-05  0:38                                               ` Andrew Rodland
2004-10-05  1:19                                               ` Rui Nuno Capela
2004-10-05  5:32                                                 ` Peter Williams
2004-10-05  6:38                                                 ` Ingo Molnar
2004-10-05  1:42                                               ` Florian Schmidt
2004-10-05  2:05                                                 ` Florian Schmidt
2004-10-05  3:09                                                 ` Andrew Rodland
2004-10-05 10:24                                                   ` Florian Schmidt
2004-10-05  7:02                                               ` [patch] voluntary-preempt-2.6.9-rc3-mm2-T0 Ingo Molnar
2004-10-05 11:11                                                 ` Rui Nuno Capela
2004-10-05 11:17                                                   ` Ingo Molnar
2004-10-05 12:07                                                     ` Hugh Dickins
2004-10-05 11:12                                                 ` Florian Schmidt
2004-10-05 11:03                                                   ` Ingo Molnar
2004-10-05 11:14                                                     ` Rui Nuno Capela
2004-10-05 11:16                                                       ` Ingo Molnar
2004-10-05 13:47                                               ` [patch] voluntary-preempt-2.6.9-rc3-mm2-T1 Ingo Molnar
2004-10-05 16:37                                                 ` Rui Nuno Capela
2004-10-05 18:42                                                   ` Ingo Molnar
2004-10-05 19:38                                                     ` Rui Nuno Capela
2004-10-05 19:44                                                       ` Ingo Molnar
2004-10-05 20:01                                                         ` Rui Nuno Capela
2004-10-06  0:12                                                         ` Lee Revell
2004-10-06  7:51                                                           ` Ingo Molnar
2004-10-07 10:52                                                 ` [patch] voluntary-preempt-2.6.9-rc3-mm3-T3 Ingo Molnar
     [not found]                                                   ` <20041007134116.3e53b239.h.mth@web.de>
2004-10-07 11:44                                                     ` Ingo Molnar
2004-10-07 12:08                                                       ` Hanno Meyer-Thurow
2004-10-07 12:16                                                   ` Rui Nuno Capela
2004-10-07 13:53                                                   ` Rui Nuno Capela
2004-10-07 14:13                                                     ` voluntary-preempt-2.6.9-rc3-mm3-T3 Con Kolivas
2004-10-07 23:26                                                     ` [patch] voluntary-preempt-2.6.9-rc3-mm3-T3 Rui Nuno Capela
2004-10-08  5:36                                                       ` Lee Revell
2004-10-08  6:49                                                         ` Con Kolivas
2004-10-08 18:05                                                           ` Lee Revell
2004-10-08  7:06                                                         ` Ingo Molnar
2004-10-08  7:36                                                           ` Peter Williams
2004-10-08 17:27                                                             ` Lee Revell
2004-10-07 17:55                                                   ` K.R. Foley
2004-10-07 20:29                                                     ` K.R. Foley
2004-10-07 21:55                                                       ` Ingo Molnar
2004-10-08  1:41                                                         ` K.R. Foley
2004-10-08  7:02                                                           ` Ingo Molnar
2004-10-08 14:03                                                             ` K.R. Foley
2004-10-08 14:28                                                               ` Ingo Molnar
2004-10-08 21:14                                                   ` Lee Revell
2004-10-08 23:11                                                   ` Lee Revell
2004-10-09  4:16                                                   ` Lee Revell
2004-10-09  4:57                                                   ` Lee Revell
2004-10-09  5:09                                                     ` voluntary-preempt-2.6.9-rc3-mm3-T3 Con Kolivas
2004-10-09  5:21                                                       ` voluntary-preempt-2.6.9-rc3-mm3-T3 Lee Revell
2004-10-09  5:23                                                         ` voluntary-preempt-2.6.9-rc3-mm3-T3 Con Kolivas
2004-10-09  5:31                                                           ` voluntary-preempt-2.6.9-rc3-mm3-T3 Lee Revell
2004-10-09  5:34                                                             ` voluntary-preempt-2.6.9-rc3-mm3-T3 Con Kolivas
2004-10-09  5:50                                                               ` Preemption model (was Re: voluntary-preempt-2.6.9-rc3-mm3-T3) Lee Revell
2004-10-09  5:53                                                                 ` Con Kolivas
2004-10-09 10:46                                                         ` voluntary-preempt-2.6.9-rc3-mm3-T3 Ingo Molnar
2004-10-09 13:21                                                         ` voluntary-preempt-2.6.9-rc3-mm3-T3 K.R. Foley
2004-10-09 18:16                                                   ` [patch] voluntary-preempt-2.6.9-rc3-mm3-T3 Florian Schmidt
2004-10-11 14:29                                                   ` [patch] CONFIG_PREEMPT_REALTIME, 'Fully Preemptible Kernel', VP-2.6.9-rc4-mm1-T4 Ingo Molnar
2004-10-11 17:48                                                     ` Florian Schmidt
2004-10-11 21:22                                                     ` Rui Nuno Capela
2004-10-11 21:37                                                       ` Lee Revell
2004-10-12  4:30                                                   ` [patch] voluntary-preempt-2.6.9-rc3-mm3-T3 Lee Revell
2004-10-12  9:17                                                     ` Ingo Molnar
2004-10-13 16:52                                                       ` Lee Revell
2004-10-13 16:48                                                   ` Lee Revell
2004-10-08 11:16                                                 ` [patch] voluntary-preempt-2.6.9-rc3-mm2-T1 William Lee Irwin III
2004-09-22 17:30                                 ` Oops in __posix_lock_file was:Re: [patch] voluntary-preempt-2.6.9-rc2-mm1-S2 K.R. Foley
2004-09-22 19:43                                   ` Ingo Molnar
2004-09-21 18:24                           ` [patch] voluntary-preempt-2.6.9-rc2-mm1-S1 K.R. Foley
2004-09-21 19:21                             ` Ingo Molnar
2004-09-21 19:37                               ` K.R. Foley
2004-09-08  6:56       ` [patch] voluntary-preempt-2.6.9-rc1-bk12-R6 Lee Revell
2004-09-09 19:29         ` Ingo Molnar
2004-09-09 19:33           ` Lee Revell
2004-09-09 20:43             ` Lee Revell
2004-09-09 20:51               ` Ingo Molnar
2004-09-09 21:03               ` Scott Wood
2004-09-09 20:05           ` Andrew Morton
2004-09-09 20:09             ` Alan Cox
2004-09-09 21:28               ` Andrew Morton
2004-09-09 22:45             ` William Lee Irwin III
2004-09-09 22:11               ` Alan Cox
2004-09-09 23:20                 ` William Lee Irwin III
2004-09-10 13:28             ` Ingo Molnar
2004-09-10 14:28               ` Paolo Ciarrocchi
2004-09-10 16:45                 ` Lee Revell
2004-09-10 22:54               ` Lee Revell
2004-09-11  0:21                 ` K.R. Foley
2004-09-09 20:13           ` Lee Revell
2004-09-22  0:17           ` William Lee Irwin III
2004-09-07 22:55     ` [patch] voluntary-preempt-2.6.9-rc1-bk12-R5 Lee Revell
2004-09-07 23:13       ` Lee Revell
2004-09-07 23:58         ` Rui Nuno Capela
2004-09-08  8:23           ` Ingo Molnar
2004-09-08  8:31             ` Ingo Molnar
2004-09-09 11:09               ` Rui Nuno Capela
2004-09-15  1:16                 ` Lee Revell
2004-09-15  9:29                   ` Rui Nuno Capela
2004-09-15  9:38                     ` Ingo Molnar
2004-09-15  9:53                       ` Rui Nuno Capela
2004-09-15 10:00                         ` Ingo Molnar
2004-09-15 10:35                           ` Rui Nuno Capela
2004-09-25 19:26               ` Lee Revell
2004-09-25 20:38                 ` Ingo Molnar
2004-09-25 20:40                   ` Lee Revell
2004-09-25 20:50                     ` Duncan Sands
2004-09-25 23:54                       ` Lee Revell
2004-09-26 13:42                         ` Rui Nuno Capela
2004-09-08  8:46             ` Rui Nuno Capela
2004-09-08  8:52               ` Ingo Molnar
2004-09-05 14:49   ` [patch] voluntary-preempt-2.6.9-rc1-bk4-R4 Florian Schmidt
2004-09-05 14:53     ` K.R. Foley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040921071854.GA7604@elte.hu \
    --to=mingo@elte.hu \
    --cc=Mark_H_Johnson@Raytheon.com \
    --cc=kr@cybsft.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rlrevell@joe-job.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.