[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: patch: highmem zero-bounce
- To: Jens Axboe <axboe@suse.de>
- Subject: Re: patch: highmem zero-bounce
- From: Andrea Arcangeli <andrea@suse.de>
- Date: Fri, 6 Jul 2001 15:41:38 +0200
- Cc: Linux Kernel <linux-kernel@vger.kernel.org>, linux-mm@kvack.org,"ZINKEVICIUS,MATT (HP-Loveland,ex1)" <matt_zinkevicius@hp.com>
- In-Reply-To: <20010627191229.G17905@suse.de>; from axboe@suse.de on Wed, Jun 27, 2001 at 07:12:29PM +0200
- References: <20010626182215.C14460@suse.de> <20010627114155.A31910@athlon.random> <20010627182745.D17905@suse.de> <20010627184908.E17905@suse.de> <20010627190626.E24623@athlon.random> <20010627191229.G17905@suse.de>
- Sender: owner-linux-mm@kvack.org
On Wed, Jun 27, 2001 at 07:12:29PM +0200, Jens Axboe wrote:
> Humm yes, I agree. I'll redo it tonight and send an updated
> incremental. Hopefully I'll be able to upload a new full version too.
I was going to integrate the avoid-bounce-buffer support but I don't
find anything recent except the bio patch for 2.5 that you uploaded
yesterday:
andrea@athlon:~/mirror/kernel.org/people/axboe > find -mtime -1
./v2.5
./v2.5/bio-14-pre4
andrea@athlon:~/mirror/kernel.org/people/axboe > find -mtime -25
./v2.5
./v2.5/bio-14-pre4
andrea@athlon:~/mirror/kernel.org/people/axboe >
The bio patch would better be 2.5 material, I'd prefer only skipping the
bounce between 1G to 4G in 2.4. Could you make a new patch with only the
bounce skip between 1G and 4G against pre3?
btw, the latest bio patch from yesterday is still broken with respect to
nested irqs:
+static inline void *kmap_atomic(struct page *page, enum km_type type)
+{
+ unsigned long flags;
+ void *vaddr;
+
+ __save_flags(flags);
+ __cli();
+ vaddr = __kmap_atomic(page, type);
+ __restore_flags(flags);
+
+ return vaddr;
+}
[..]
+static inline void kunmap_atomic(void *kvaddr, enum km_type type)
+{
+#if HIGHMEM_DEBUG
+ unsigned long flags;
+
+ __save_flags(flags);
+ __cli();
+ __kunmap_atomic(kvaddr, type);
+ __restore_flags(flags);
#endif
}
[..]
+#define bio_kmap_irq(bio) (kmap_atomic(bio_page((bio)), KM_BIO_IRQ) + bio_offset((bio)))
+#define bio_kunmap_irq(ptr) kunmap_atomic((void *) (((unsigned long) (ptr)) & PAGE_MASK), KM_BIO_IRQ)
[..]
+extern inline void *ide_map_buffer(struct request *rq)
+{
+ return bio_kmap_irq(rq->bio) + ide_rq_offset(rq);
+}
+
+extern inline void ide_unmap_buffer(char *buffer)
+{
+ bio_kunmap_irq(buffer);
+}
[..]
+ char *to = ide_map_buffer(rq);
+ idedisk_output_data (drive, to, SECTOR_WORDS);
+ ide_unmap_buffer(to);
[..]
the __cli() and __restore_flags() are not needed in kmap_atomic, and the
bio_kmap_irq is still broken, the suprious __restore_flags in
kmap_atomic is enabling irq again before you do the PIO, that will
corrupt the pte of the KM_BIO_IRQ if a nested irq runs under us.
In short you don't need to __save_flags(); __cli() for all the KM but
the BIO_IRQ one, and in the BIO_IRQ case you need to __restore_flags not
after setting the pagetable, but after also all the I/O is finished (so
in the kunmap, not in the kmap).
Andrea
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/