Re: [RFC PATCH 02/11] mm/mempolicy: swap cond reference counting logic in do_get_mempolicy

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

 



[restoring the CC list, I supect you didn't want this to be a private
discussion]

On Tue 28-11-23 09:10:18, Gregory Price wrote:
> On Tue, Nov 28, 2023 at 03:07:10PM +0100, Michal Hocko wrote:
> > On Wed 22-11-23 16:11:51, Gregory Price wrote:
> > [...]
> > > @@ -982,11 +991,11 @@ static long do_get_mempolicy(int *policy, nodemask_t *nmask,
> > >  	}
> > >  
> > >   out:
> > > -	mpol_cond_put(pol);
> > > +	mpol_put(pol);
> > >  	if (vma)
> > >  		mmap_read_unlock(mm);
> > >  	if (pol_refcount)
> > > -		mpol_put(pol_refcount);
> > > +		mpol_cond_put(pol_refcount);
> > 
> > Maybe I am just misreading the patch but pol_refcount should be always
> > NULL with this patch
> > 
> 
> earlier:
> 
> +               pol = pol_refcount = __get_vma_policy(vma, addr, &ilx);
> 
> i can split this into two lines if preferred.
> 
> If addr is not set, then yes pol_refcount is always null.

My bad, missed that. Making that two lines would be easier to read but
nothing I would insist on of course.

-- 
Michal Hocko
SUSE Labs




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux