linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] IDE: Save a call to PageHighMem()
@ 2009-06-23  8:12 Jean Delvare
  2009-06-23  9:48 ` Bartlomiej Zolnierkiewicz
  0 siblings, 1 reply; 5+ messages in thread
From: Jean Delvare @ 2009-06-23  8:12 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz; +Cc: linux-ide

PageHighMem() isn't cheap so avoid calling it twice on the same page.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
 drivers/ide/ide-taskfile.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

--- linux-2.6.31-pre.orig/drivers/ide/ide-taskfile.c	2009-06-23 09:01:10.000000000 +0200
+++ linux-2.6.31-pre/drivers/ide/ide-taskfile.c	2009-06-23 09:50:33.000000000 +0200
@@ -236,6 +236,7 @@ void ide_pio_bytes(ide_drive_t *drive, s
 
 	while (len) {
 		unsigned nr_bytes = min(len, cursg->length - cmd->cursg_ofs);
+		int page_is_high;
 
 		if (nr_bytes > PAGE_SIZE)
 			nr_bytes = PAGE_SIZE;
@@ -247,7 +248,8 @@ void ide_pio_bytes(ide_drive_t *drive, s
 		page = nth_page(page, (offset >> PAGE_SHIFT));
 		offset %= PAGE_SIZE;
 
-		if (PageHighMem(page))
+		page_is_high = PageHighMem(page);
+		if (page_is_high)
 			local_irq_save(flags);
 
 		buf = kmap_atomic(page, KM_BIO_SRC_IRQ) + offset;
@@ -268,7 +270,7 @@ void ide_pio_bytes(ide_drive_t *drive, s
 
 		kunmap_atomic(buf, KM_BIO_SRC_IRQ);
 
-		if (PageHighMem(page))
+		if (page_is_high)
 			local_irq_restore(flags);
 
 		len -= nr_bytes;


-- 
Jean Delvare

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

* Re: [PATCH] IDE: Save a call to PageHighMem()
  2009-06-23  8:12 [PATCH] IDE: Save a call to PageHighMem() Jean Delvare
@ 2009-06-23  9:48 ` Bartlomiej Zolnierkiewicz
  2009-06-23 10:00   ` Jean Delvare
  0 siblings, 1 reply; 5+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2009-06-23  9:48 UTC (permalink / raw)
  To: Jean Delvare; +Cc: linux-ide, David Miller

On Tuesday 23 June 2009 10:12:39 Jean Delvare wrote:
> PageHighMem() isn't cheap so avoid calling it twice on the same page.
> 
> Signed-off-by: Jean Delvare <khali@linux-fr.org>
> Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>

Acked-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>

PS Please send IDE patches to Dave in the future, thanks.

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

* Re: [PATCH] IDE: Save a call to PageHighMem()
  2009-06-23  9:48 ` Bartlomiej Zolnierkiewicz
@ 2009-06-23 10:00   ` Jean Delvare
  2009-06-23 10:06     ` David Miller
  2009-06-23 10:11     ` Bartlomiej Zolnierkiewicz
  0 siblings, 2 replies; 5+ messages in thread
From: Jean Delvare @ 2009-06-23 10:00 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz; +Cc: linux-ide, David Miller

Hi Bartlomiej,

On Tue, 23 Jun 2009 11:48:31 +0200, Bartlomiej Zolnierkiewicz wrote:
> On Tuesday 23 June 2009 10:12:39 Jean Delvare wrote:
> > PageHighMem() isn't cheap so avoid calling it twice on the same page.
> > 
> > Signed-off-by: Jean Delvare <khali@linux-fr.org>
> > Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
> 
> Acked-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>

Thanks.

> PS Please send IDE patches to Dave in the future, thanks.

I followed what MAINTAINERS says, and will keep doing so in the future.
If the information stored there is outdated, please update it.

-- 
Jean Delvare

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

* Re: [PATCH] IDE: Save a call to PageHighMem()
  2009-06-23 10:00   ` Jean Delvare
@ 2009-06-23 10:06     ` David Miller
  2009-06-23 10:11     ` Bartlomiej Zolnierkiewicz
  1 sibling, 0 replies; 5+ messages in thread
From: David Miller @ 2009-06-23 10:06 UTC (permalink / raw)
  To: khali; +Cc: bzolnier, linux-ide

From: Jean Delvare <khali@linux-fr.org>
Date: Tue, 23 Jun 2009 12:00:18 +0200

> Hi Bartlomiej,
> 
> On Tue, 23 Jun 2009 11:48:31 +0200, Bartlomiej Zolnierkiewicz wrote:
>> PS Please send IDE patches to Dave in the future, thanks.
> 
> I followed what MAINTAINERS says, and will keep doing so in the future.
> If the information stored there is outdated, please update it.

We did, just Linus hasn't taken my pull yet.  Will poke him about
it.

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

* Re: [PATCH] IDE: Save a call to PageHighMem()
  2009-06-23 10:00   ` Jean Delvare
  2009-06-23 10:06     ` David Miller
@ 2009-06-23 10:11     ` Bartlomiej Zolnierkiewicz
  1 sibling, 0 replies; 5+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2009-06-23 10:11 UTC (permalink / raw)
  To: Jean Delvare; +Cc: linux-ide, David Miller

On Tuesday 23 June 2009 12:00:18 Jean Delvare wrote:
> Hi Bartlomiej,
> 
> On Tue, 23 Jun 2009 11:48:31 +0200, Bartlomiej Zolnierkiewicz wrote:
> > On Tuesday 23 June 2009 10:12:39 Jean Delvare wrote:
> > > PageHighMem() isn't cheap so avoid calling it twice on the same page.
> > > 
> > > Signed-off-by: Jean Delvare <khali@linux-fr.org>
> > > Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
> > 
> > Acked-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
> 
> Thanks.
> 
> > PS Please send IDE patches to Dave in the future, thanks.
>
> I followed what MAINTAINERS says, and will keep doing so in the future.

Yeah, I know.. ;)

> If the information stored there is outdated, please update it.

Dave has already sent a patch to update it but it is not applied yet.

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

end of thread, other threads:[~2009-06-23 10:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-23  8:12 [PATCH] IDE: Save a call to PageHighMem() Jean Delvare
2009-06-23  9:48 ` Bartlomiej Zolnierkiewicz
2009-06-23 10:00   ` Jean Delvare
2009-06-23 10:06     ` David Miller
2009-06-23 10:11     ` Bartlomiej Zolnierkiewicz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).