lkml.org 
[lkml]   [2020]   [Jun]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] mm/hmm: remove redundant check non_swap_entry()
On Fri, Jun 12, 2020 at 12:53:23PM -0700, Ralph Campbell wrote:
>
> On 6/12/20 12:42 PM, Jason Gunthorpe wrote:
> > On Fri, Jun 12, 2020 at 12:35:24PM -0700, Matthew Wilcox wrote:
> > > On Fri, Jun 12, 2020 at 12:26:18PM -0700, Ralph Campbell wrote:
> > > > In zap_pte_range(), the check for non_swap_entry() and
> > > > is_device_private_entry() is redundant since the latter is a subset of the
> > > > former. Remove the redundant check to simplify the code and for clarity.
> > >
> > > That is highly configuration dependent.
> > >
> > > #else /* CONFIG_DEVICE_PRIVATE */
> > > ...
> > > static inline bool is_device_private_entry(swp_entry_t entry)
> > > {
> > > return false;
> > > }
> >
> > The commit message might be a bit confusing, as it is not a subset, I
> > would say that device_private_entry alone is sufficient to tell if the
> > entry is private or not.
> >
> > For the !CONFIG_DEVICE_PRIVATE case having it wired to false is
> > right.
> >
> > Jason
> >
>
> How about the following message instead?
>
> In zap_pte_range(), the check for non_swap_entry() and
> is_device_private_entry() is unnecessary since the latter is sufficient
> to determine if the page is a device private page. Remove the test for
> non_swap_entry() to simplify the code and for clarity.

Yes, that is clearer to me

Jason

\
 
 \ /
  Last update: 2020-06-12 21:57    [W:0.097 / U:0.144 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site