Re: [PATCH v6 2/5] lazy tlb: allow lazy tlb mm refcounting to be configurable

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

 



On Mon Jan 23, 2023 at 6:02 PM AEST, Nadav Amit wrote:
>
>
> On 1/23/23 9:35 AM, Nadav Amit wrote:
> >> +    if (IS_ENABLED(CONFIG_MMU_LAZY_TLB_REFCOUNT)) {
> >> +        mmdrop(mm);
> >> +    } else {
> >> +        /*
> >> +         * mmdrop_lazy_tlb must provide a full memory barrier, see the
> >> +         * membarrier comment finish_task_switch which relies on this.
> >> +         */
> >> +        smp_mb();
> >> +    }
> >>   }
> > 
> > Considering the fact that mmdrop_lazy_tlb() replaced mmdrop() in various 
> > locations in which smp_mb() was not required, this comment might be 
> > confusing. IOW, for the cases in most cases where mmdrop_lazy_tlb() 
> > replaced mmdrop(), this comment was irrelevant, and therefore it now 
> > becomes confusing.
> > 
> > I am not sure the include the smp_mb() here instead of "open-coding" it 
> > helps.
> I think that I now understand why you do need the smp_mb() here, so 
> ignore my comment.

For the moment it's basically a convenience thing so the caller does not
have to care what option is configured. Possibly we could weaken it and
do necessary barriers in callers if we consolidated to one option, but
I'd have to be convinced it'd be worthwhile, because it would still make
it deviate from mmdrop(), and we'd probably at least need a release
barrier to drop the reference.

Thanks,
Nick





[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