Re: [PATCH -v2] Resource: fix region_intersects() for CXL memory

From: Huang, Ying
Date: Wed Sep 04 2024 - 23:04:23 EST


Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx> writes:

> On Wed, Sep 04, 2024 at 03:48:44PM +0800, Huang, Ying wrote:
>> Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx> writes:
>> > On Mon, Aug 19, 2024 at 10:34:13AM +0800, Huang Ying wrote:
>

[snip]

>
>> >> + ostart = max(res.start, p->start);
>> >> + oend = min(res.end, p->end);
>> >
>> > Isn't a reinvention of resource_intersection()? With that in place you may also
>> > drop the above resource_overlaps().
>>
>> sizeof(struct resource) == 8 * sizeof(unsigned long)
>>
>> Just want to avoid to define another struct resource on stack.
>
> Is it a problem?

Not a serious problem. Just prefer to avoid too much stack usage.
IMHO, the benefit isn't large too.

--
Best Regards,
Huang, Ying