Re: [PATCH v2 01/15] mm/mmu_notifier: define the header pre-processor parts even if disabled

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

 



On Tue, Nov 05, 2019 at 01:23:46PM -0800, John Hubbard wrote:
> On 10/28/19 1:10 PM, Jason Gunthorpe wrote:
> > From: Jason Gunthorpe <jgg@xxxxxxxxxxxx>
> > 
> > Now that we have KERNEL_HEADER_TEST all headers are generally compile
> > tested, so relying on makefile tricks to avoid compiling code that depends
> > on CONFIG_MMU_NOTIFIER is more annoying.
> > 
> > Instead follow the usual pattern and provide most of the header with only
> > the functions stubbed out when CONFIG_MMU_NOTIFIER is disabled. This
> > ensures code compiles no matter what the config setting is.
> > 
> > While here, struct mmu_notifier_mm is private to mmu_notifier.c, move it.
> 
> and correct a minor spelling error in a comment. Good. :)
> 
> > 
> > Reviewed-by: Jérôme Glisse <jglisse@xxxxxxxxxx>
> > Signed-off-by: Jason Gunthorpe <jgg@xxxxxxxxxxxx>
> >  include/linux/mmu_notifier.h | 46 +++++++++++++-----------------------
> >  mm/mmu_notifier.c            | 13 ++++++++++
> >  2 files changed, 30 insertions(+), 29 deletions(-)
> > 
> 
> Because this is correct as-is, you can add:
> 
> Reviewed-by: John Hubbard <jhubbard@xxxxxxxxxx>
> 

Thanks

> diff --git a/mm/mmu_notifier.c b/mm/mmu_notifier.c
> index 2b7485919ecf..107f9406a92d 100644
> +++ b/mm/mmu_notifier.c
> @@ -47,6 +47,16 @@ struct mmu_notifier_mm {
>         struct hlist_head deferred_list;
>  };
>  
> +int mm_has_notifiers(struct mm_struct *mm)
> +{
> +       return unlikely(mm->mmu_notifier_mm);
> +}

This inline is performance sensitive, it needs to stay inlined..

Jason
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux