Re: [PATCH] KUnit: memcpy: add benchmark
From: Andrew Morton
Date: Thu Jan 29 2026 - 18:53:20 EST
On Fri, 30 Jan 2026 00:36:30 +0100 Matteo Croce <technoboy85@xxxxxxxxx> wrote:
> > Is cond_resched() inside preempt_disable() actually legal?
> >
> > Might be, but it doesn't make a lot of sense, does it?
> >
> > > + }
> > > + preempt_enable();
> > > +
> >
>
> Right. In a previous version I was doing
> preempt_disable()/preempt_enable() around the two ktime_get_ns(), but
> then I thought that enabling and disabling preemption 100 time was too
> much.
> I'll restore the preempt macros around the actual copy and remove
> cond_resched().
OK.
local_irq_save() would be more accurate.
Does it really need to copy 4MB? Smaller would make
local_irq_disable() more viable.
kmalloc(4MB) does seem to be pushing our luck. I'm spotting
./arch/arm/configs/pxa_defconfig:CONFIG_ARCH_FORCE_MAX_ORDER=8
which is 1MB?