Re: [PATCH v7 2/4] mm,page_owner: Implement the tracking of the stacks count

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

 



On Fri, Feb 09, 2024 at 10:44:23PM +0100, Marco Elver wrote:
> > >                   * set a refcount of 1 ourselves.
> > >                   */
> > >                  if (refcount_read(&stack->count) == REFCOUNT_SATURATED)
> > >                          refcount_set(&stack->count, 1);
> 
> Do you need to inc the first allocation? Should there be an "else"
> here instead of always doing refcount_inc()?

Yes, I need to inc in the first allocation, otherwise on the first free
op, refcount goes to 0, and when the next allocation comes around,
I will get a warning because of going from refcount 0 to 1.


-- 
Oscar Salvador
SUSE Labs




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux