Re: [PATCH] x86/mm: Allow clflush_cache_range() to flush large ranges

From: Wencheng Yang

Date: Tue Dec 01 2026 - 08:40:25 EST


Yes. In my driver, I call clflush_cache_range() with a size greater than 4 GiB,
which causes the size argument to be truncated and only part of the intended
range to be flushed.

I don't see a reason why this API should limit the size to less than 4 GiB,
as flushing a memory range larger than 4 GiB is also a valid use case.

Thanks.

On Mon, Nov 30, 2026 at 11:02 PM Dave Hansen <dave.hansen@xxxxxxxxx> wrote:
>
> On 11/29/26 22:57, Yang Wencheng wrote:
> > clflush_cache_range() accepts an unsigned int size even though several
> > callers naturally pass size_t values. Ranges larger than UINT_MAX are
> > therefore truncated and only partially flushed.
> >
> > Use size_t for the public interface and its internal helper so the
> > complete range is preserved.
>
> Does this cause any practical problems?