lkml.org 
[lkml]   [2018]   [Sep]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v3 4/5] x86/mm: optimize static_protection() by using overlap()
Date
On Fri, 2018-09-07 at 10:21 +0200, Thomas Gleixner wrote:
> On Fri, 7 Sep 2018, Yang, Bin wrote:
> > On Fri, 2018-09-07 at 09:49 +0200, Thomas Gleixner wrote:
> > > On Fri, 7 Sep 2018, Yang, Bin wrote:
> > > > On Tue, 2018-09-04 at 14:22 +0200, Thomas Gleixner wrote:
> > > >
> > > > I just write a test.c to compare the result between overlap() and
> > > > original within().
> > >
> > > You are right. Your version of doing the overlap exclusive works. I misread
> > > the conditions. I still prefer doing inclusive checks because they are way
> > > more obvious.
> >
> > I am sorry for my poor english. What is "inclusive checks"?
>
> Exlusive: val >= start && val < end
>
> Inclusive: val >= start && val <= end
>
> So the difference is that you feed exclusive with:
>
> end = start + size
>
> and inclusive with
>
> end = start + size - 1
>

Thanks. I will change it to inclusive check.

> Thanks,
>
> tglx
>
>
\
 
 \ /
  Last update: 2018-09-07 10:27    [W:0.049 / U:0.244 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site