lkml.org 
[lkml]   [2018]   [Jul]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 1/6] swap: Add comments to lock_cluster_or_swap_info()
From
Date
> +/*
> + * At most times, fine grained cluster lock is sufficient to protect

Can we call out those times, please?

> + * the operations on sis->swap_map.

Please be careful with the naming. You can call it 'si' because that's
what the function argument is named. Or, swap_info_struct because
that's the struct name. Calling it 'sis' is a bit sloppy, no?

> No need to acquire gross grained

"coarse" is a conventional antonym for "fine".

> + * sis->lock. But cluster and cluster lock isn't available for HDD,
> + * so sis->lock will be instead for them.
> + */
> static inline struct swap_cluster_info *lock_cluster_or_swap_info(
> struct swap_info_struct *si,
> unsigned long offset)

What I already knew was: there are two locks. We use one sometimes and
the other at other times.

What I don't know is why there are two locks, and the heuristics why we
choose between them. This comment doesn't help explain the things I
don't know.

\
 
 \ /
  Last update: 2018-07-15 22:06    [W:0.088 / U:0.204 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site