Skip to contentSkip to conversation

IDE: Save a call to PageHighMem()

PATCH In review Jean Delvare 3 participants 5 messages Jun 23, 2009 libata

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 IDE: Save a call to PageHighMem()

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

Cc Bartlomiej Zolnierkiewicz <[email protected]>
---
 drivers/ide/ide-taskfile.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/ide/ide-taskfile.c +4 -2
@@ -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;
Signature · 1 line
Jean Delvare
#2 lore raw

Hi Bartlomiej,

Quoted 7 lines · Bartlomiej Zolnierkiewicz
Quoted 4 lines · On Tuesday 23 June 2009 10:12:39 Jean Delvare wrote:

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

Cc Bartlomiej Zolnierkiewicz <[email protected]>

Thanks.

Quoted 1 line

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.

Signature · 1 line
Jean Delvare
#3 lore raw
Quoted 9 lines · On Tuesday 23 June 2009 12:00:18 Jean Delvare wrote:

Hi Bartlomiej,

Quoted 6 lines · Bartlomiej Zolnierkiewicz
Quoted 4 lines · On Tuesday 23 June 2009 10:12:39 Jean Delvare wrote:

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

Cc Bartlomiej Zolnierkiewicz <[email protected]>
Quoted 7 lines
Quoted 1 line

Thanks.

Quoted 1 line

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.. ;)

Quoted 1 line

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.

#4 lore raw
In reply to Jean Delvare

From: Jean Delvare <[email protected]>
Date: Tue, 23 Jun 2009 12:00:18 +0200

Quoted 7 lines

Hi Bartlomiej,

Quoted 1 line · Bartlomiej Zolnierkiewicz

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.