public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
* Why does salinfo_log_read_cpu use kmalloc?
@ 2003-10-08  7:08 Keith Owens
  2003-10-08 11:47 ` Matthew Wilcox
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Keith Owens @ 2003-10-08  7:08 UTC (permalink / raw)
  To: linux-ia64

Why does arch/ia64/kernel/salinfo.c::salinfo_log_read_cpu() use
kmalloc() for the log buffer?  The code is running virtual with
interrupts enabled, SAL_GET_STATE_INFO has no special requirements for
the buffer attributes, so why not use vmalloc()?


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Why does salinfo_log_read_cpu use kmalloc?
  2003-10-08  7:08 Why does salinfo_log_read_cpu use kmalloc? Keith Owens
@ 2003-10-08 11:47 ` Matthew Wilcox
  2003-10-08 12:48 ` Keith Owens
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Matthew Wilcox @ 2003-10-08 11:47 UTC (permalink / raw)
  To: linux-ia64

On Wed, Oct 08, 2003 at 05:08:14PM +1000, Keith Owens wrote:
> Why does arch/ia64/kernel/salinfo.c::salinfo_log_read_cpu() use
> kmalloc() for the log buffer?  The code is running virtual with
> interrupts enabled, SAL_GET_STATE_INFO has no special requirements for
> the buffer attributes, so why not use vmalloc()?

I don't see a function called salinfo_log_read_cpu in
arch/ia64/kernel/salinfo.c ... moreover, I don't see any occurrences of
the string "alloc" in that file.  Sure you're looking at the right tree?

-- 
"It's not Hollywood.  War is real, war is primarily not about defeat or
victory, it is about death.  I've seen thousands and thousands of dead bodies.
Do you think I want to have an academic debate on this subject?" -- Robert Fisk

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Why does salinfo_log_read_cpu use kmalloc?
  2003-10-08  7:08 Why does salinfo_log_read_cpu use kmalloc? Keith Owens
  2003-10-08 11:47 ` Matthew Wilcox
@ 2003-10-08 12:48 ` Keith Owens
  2003-10-08 15:55 ` Bjorn Helgaas
  2003-10-09  3:13 ` Keith Owens
  3 siblings, 0 replies; 5+ messages in thread
From: Keith Owens @ 2003-10-08 12:48 UTC (permalink / raw)
  To: linux-ia64

On Wed, 8 Oct 2003 12:47:39 +0100, 
Matthew Wilcox <willy@debian.org> wrote:
>On Wed, Oct 08, 2003 at 05:08:14PM +1000, Keith Owens wrote:
>> Why does arch/ia64/kernel/salinfo.c::salinfo_log_read_cpu() use
>> kmalloc() for the log buffer?  The code is running virtual with
>> interrupts enabled, SAL_GET_STATE_INFO has no special requirements for
>> the buffer attributes, so why not use vmalloc()?
>
>I don't see a function called salinfo_log_read_cpu in
>arch/ia64/kernel/salinfo.c ... moreover, I don't see any occurrences of
>the string "alloc" in that file.  Sure you're looking at the right tree?

2.4.22-ia64-030909 and 2.4.22 pristine.  For some reason, this code is
not in the 2.6 trees.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Why does salinfo_log_read_cpu use kmalloc?
  2003-10-08  7:08 Why does salinfo_log_read_cpu use kmalloc? Keith Owens
  2003-10-08 11:47 ` Matthew Wilcox
  2003-10-08 12:48 ` Keith Owens
@ 2003-10-08 15:55 ` Bjorn Helgaas
  2003-10-09  3:13 ` Keith Owens
  3 siblings, 0 replies; 5+ messages in thread
From: Bjorn Helgaas @ 2003-10-08 15:55 UTC (permalink / raw)
  To: linux-ia64

On Wednesday 08 October 2003 1:08 am, Keith Owens wrote:
> Why does arch/ia64/kernel/salinfo.c::salinfo_log_read_cpu() use
> kmalloc() for the log buffer?  The code is running virtual with
> interrupts enabled, SAL_GET_STATE_INFO has no special requirements for
> the buffer attributes, so why not use vmalloc()?

It's usually called via smp_call_function_single(), which uses
an IPI to make it happen on another processor.  I thought
this meant the function got called with interrupts disabled,
but I could be wrong.

And yes, I do need to push this to 2.6.  It's on my to-do list.

Bjorn


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Why does salinfo_log_read_cpu use kmalloc?
  2003-10-08  7:08 Why does salinfo_log_read_cpu use kmalloc? Keith Owens
                   ` (2 preceding siblings ...)
  2003-10-08 15:55 ` Bjorn Helgaas
@ 2003-10-09  3:13 ` Keith Owens
  3 siblings, 0 replies; 5+ messages in thread
From: Keith Owens @ 2003-10-09  3:13 UTC (permalink / raw)
  To: linux-ia64

On Wed, 8 Oct 2003 09:55:44 -0600, 
Bjorn Helgaas <bjorn.helgaas@hp.com> wrote:
>On Wednesday 08 October 2003 1:08 am, Keith Owens wrote:
>> Why does arch/ia64/kernel/salinfo.c::salinfo_log_read_cpu() use
>> kmalloc() for the log buffer?  The code is running virtual with
>> interrupts enabled, SAL_GET_STATE_INFO has no special requirements for
>> the buffer attributes, so why not use vmalloc()?
>
>It's usually called via smp_call_function_single(), which uses
>an IPI to make it happen on another processor.  I thought
>this meant the function got called with interrupts disabled,
>but I could be wrong.

So the question becomes, why use smp_call_function_single() and have
the code run disabled?  salinfo_log_read_cpu() is performing work on
behalf of a user process, we can use set_cpus_allowed() and let the
scheduler run the code on the required cpu with interrupts enabled.

Any objections if I do a patch to replace smp_call_function_single()
with set_cpus_allowed(), so reading the records from SAL does not block
OS interrupts?  For the special case when the task is on the cpu that
salinfo wants to read from, the existing code does not use IPI so it
calls SAL with interrupts enabled.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2003-10-09  3:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-10-08  7:08 Why does salinfo_log_read_cpu use kmalloc? Keith Owens
2003-10-08 11:47 ` Matthew Wilcox
2003-10-08 12:48 ` Keith Owens
2003-10-08 15:55 ` Bjorn Helgaas
2003-10-09  3:13 ` Keith Owens

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox