lkml.org 
[lkml]   [2005]   [Nov]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH 3/10] kdump: export per cpu crash notes pointer through sysfs
On Thu, Nov 17, 2005 at 02:07:23PM -0800, Andrew Morton wrote:
> Vivek Goyal <vgoyal@in.ibm.com> wrote:
> >
> > + /*
> > + * Might be reading other cpu's data based on which cpu read thread
> > + * has been scheduled. But cpu data (memory) is allocated once during
> > + * boot up and this data does not change there after. Hence this
> > + * operation should be safe. No locking required.
> > + */
> > + get_cpu();
> > + addr = __pa(per_cpu_ptr(crash_notes, cpunum));
> > + rc = sprintf(buf, "%Lx\n", addr);
> > + put_cpu();
>
> I don't think the get_cpu() and put_cpu() are needed here?

Thanks. I have done the changes. Please find attached the incremental patch.

Thanks
Vivek


o Removes the call to get_cpu() and put_cpu() as it is not required.

Signed-off-by: Vivek Goyal <vgoyal@in.ibm.com>
---

linux-2.6.15-rc1-mm2-1M-root/drivers/base/cpu.c | 2 --
1 files changed, 2 deletions(-)

diff -puN drivers/base/cpu.c~kdump-export-crash-notes-sysfs-remove-get-cpu drivers/base/cpu.c
--- linux-2.6.15-rc1-mm2-1M/drivers/base/cpu.c~kdump-export-crash-notes-sysfs-remove-get-cpu 2005-11-18 16:08:28.000000000 +0530
+++ linux-2.6.15-rc1-mm2-1M-root/drivers/base/cpu.c 2005-11-18 16:08:28.000000000 +0530
@@ -101,10 +101,8 @@ static ssize_t show_crash_notes(struct s
* boot up and this data does not change there after. Hence this
* operation should be safe. No locking required.
*/
- get_cpu();
addr = __pa(per_cpu_ptr(crash_notes, cpunum));
rc = sprintf(buf, "%Lx\n", addr);
- put_cpu();
return rc;
}
static SYSDEV_ATTR(crash_notes, 0400, show_crash_notes, NULL);
_
-
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/
\
 
 \ /
  Last update: 2005-11-18 13:36    [W:0.060 / U:1.280 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site