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: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;
}

...
#if defined(CONFIG_MEMORY_FAILURE) || defined(CONFIG_MIGRATION) || \
defined(CONFIG_DEVICE_PRIVATE)
static inline int non_swap_entry(swp_entry_t entry)
{
return swp_type(entry) >= MAX_SWAPFILES;
}
#else
static inline int non_swap_entry(swp_entry_t entry)
{
return 0;
}
#endif

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