2009-10-21 14:38:09

by Thomas Schlichter

[permalink] [raw]
Subject: Re: [RFC Patch] use MTRR for write combining if PAT is not available

Jan Beulich wrote:
> >Yes, I had that in the first place, but Jan suggested to extend it to also
> >handle non-aligned, non-power-of-two cases:
> > http://marc.info/?l=linux-kernel&m=125541951529918&w=2
>
> I merely pointed out it wouldn't work for unaligned addresses or sizes
> passed in.

Oh, I'm sorry, I must have misinterpreted it...

> >So if it's OK for Jan, I'll reduce the functionality again and use mtrr_add()
> >instead. Btw. this simply means to drop mtrr_add_unaligned(), all the other
> >parts are still required for reference counting and a proper mtrr_del() on file
> >close.
>
> I'm perfectly fine with just handling the aligned case, as long as the code
> checks that the alignment constraints are met.

Hmm, as far as I see mtrr_add() and mtrr_add_page() already check these
constraints. Do you want me to check them additionally? Or do you want to
completely fail the mmap() if these constraints are violated?

I'd let mmap() succeed even if the mtrr_add() fails...

Regards,
Thomas


2009-10-21 15:13:48

by Jan Beulich

[permalink] [raw]
Subject: Re: [RFC Patch] use MTRR for write combining if PAT is not available

>>> Thomas Schlichter <[email protected]> 21.10.09 16:38 >>>
>Hmm, as far as I see mtrr_add() and mtrr_add_page() already check these
>constraints. Do you want me to check them additionally? Or do you want to
>completely fail the mmap() if these constraints are violated?

I'd say you should check it explicitly in the caller, to avoid the warning
message being printed otherwise.

>I'd let mmap() succeed even if the mtrr_add() fails...

Yes, of course.

Jan