Re: [PATCH 4/5] SCSI: add cpu cache flushes after kmapping and modifying a page

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 4 Jun 2006, Tejun Heo wrote:

> Christoph Hellwig wrote:
> > On Sun, Jun 04, 2006 at 12:41:20PM +0900, Tejun Heo wrote:
> > >  			local_irq_save(flags);
> > >  			buf = kmap_atomic(sg->page, KM_IRQ0) + sg->offset;
> > >  			memcpy(buf, tw_dev->generic_buffer_virt[request_id],
> > > sg->length);
> > > +			flush_kernel_dcache_page(kmap_atomic_to_page(buf -
> > > sg->offset));
> > >  			kunmap_atomic(buf - sg->offset, KM_IRQ0);
> > >  			local_irq_restore(flags);
> > 
> > all these should switch to scsi_kmap_atomic_sg which should do the
> > flush_kernel_dcache_page call for you.
> > 
> 
> This is not specific to scsi or block.  This is a common problem for all kmap
> users.  As I wrote in the other mail, I think this should be mandated at the
> kmap/kunmap() interface.

Right. As I wrote scsi_k(un)map_atomic_sg I did mention that they, 
probably, should go to a higher layer as they were not scsi-specific, but 
as I didn't have a good idea of where exactly to put them, I called them
scsi_* and put in scsi_lib.c. Suggestions for a better place and namespace 
for them very welcome. Or just feel free to move / rename them as you see 
appropriate. See, e.g., 
http://marc.theaimsgroup.com/?l=linux-scsi&m=112345886816099&w=2 and the 
related thread from August last year for possible other potential users of 
this API.

Thanks
Guennadi
---
Guennadi Liakhovetski
-
: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux