lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAGsJ_4wfeaVeaFXAKz-7U-=ESf2uh9Ow=VDGdRXqnypHhLDJfw@mail.gmail.com>
Date: Sat, 4 May 2024 12:47:06 +0800
From: Barry Song <21cnbao@...il.com>
To: Christoph Hellwig <hch@...radead.org>
Cc: Chris Li <chrisl@...nel.org>, Ryan Roberts <ryan.roberts@....com>, akpm@...ux-foundation.org, 
	linux-mm@...ck.org, baolin.wang@...ux.alibaba.com, david@...hat.com, 
	hanchuanhua@...o.com, hannes@...xchg.org, hughd@...gle.com, 
	kasong@...cent.com, linux-kernel@...r.kernel.org, surenb@...gle.com, 
	v-songbaohua@...o.com, willy@...radead.org, xiang@...nel.org, 
	ying.huang@...el.com, yosryahmed@...gle.com, yuzhao@...gle.com, 
	ziy@...dia.com, "Rafael J. Wysocki" <rafael@...nel.org>, Pavel Machek <pavel@....cz>, 
	Len Brown <len.brown@...el.com>
Subject: Re: [PATCH v3 2/6] mm: remove swap_free() and always use swap_free_nr()

On Sat, May 4, 2024 at 12:29 PM Christoph Hellwig <hch@...radead.org> wrote:
>
> On Sat, May 04, 2024 at 12:27:11PM +0800, Barry Song wrote:
> > swap_free_nr() isn't separate, after this patch, it is the only one left.
> > there won't be swap_free() any more. it seems you want to directly
> > "rename" it to swap_free()?
>
> Yes.  Avoid the pointless suffix if it is the only variant.

well. it seems you are right. We usually use a suffix to differentiate
two or more cases, but now, there is only one case left, the suffix
seems no longer useful.

one more problem is that free_swap_and_cache_nr() and
swap_free_nr() are not quite aligned.

extern void free_swap_and_cache_nr(swp_entry_t entry, int nr);

static inline void free_swap_and_cache(swp_entry_t entry)
{
           free_swap_and_cache_nr(entry, 1);
}

The problem space is the same. I feel like in that case, we can also drop
free_swap_and_cache_nr() and simply add the nr parameter?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ