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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20091016090446.824292c4.kamezawa.hiroyu@jp.fujitsu.com>
Date:	Fri, 16 Oct 2009 09:04:46 +0900
From:	KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>
To:	Hugh Dickins <hugh.dickins@...cali.co.uk>
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	linux-kernel@...r.kernel.org, linux-mm@...ck.org
Subject: Re: [PATCH 8/9] swap_info: note SWAP_MAP_SHMEM

On Thu, 15 Oct 2009 23:23:24 +0100 (BST)
Hugh Dickins <hugh.dickins@...cali.co.uk> wrote:

> On Thu, 15 Oct 2009, KAMEZAWA Hiroyuki wrote:
> > On Thu, 15 Oct 2009 01:57:28 +0100 (BST)
> > Hugh Dickins <hugh.dickins@...cali.co.uk> wrote:
> > 
> > > While we're fiddling with the swap_map values, let's assign a particular
> > > value to shmem/tmpfs swap pages: their swap counts are never incremented,
> > > and it helps swapoff's try_to_unuse() a little if it can immediately
> > > distinguish those pages from process pages.
> > > 
> > > Since we've no use for SWAP_MAP_BAD | COUNT_CONTINUED,
> > > we might as well use that 0xbf value for SWAP_MAP_SHMEM.
> > > 
> > > Signed-off-by: Hugh Dickins <hugh.dickins@...cali.co.uk>
> > 
> > I welcome this!
> 
> Ah, I did wonder whether you might find some memcg use for it too:
> I'm guessing your welcome means that you do have some such in mind.
> 
yes, I'm thinking I can use this or not on memcg for simplifying memcg's hooks
for shmem. It's complicated ;)
I have to test memcg+shmem carefully again after this patch but I think
there will be no trouble, now.

> (By the way, there's no particular need to use that 0xbf value:
> during most of my testing I was using SWAP_MAP_SHMEM 0x3e and
> SWAP_MAP_MAX 0x3d; but then noticed that 0xbf just happened to be
> free, and also happened to sail through the tests in the right way.
> But if it ever becomes a nuisance there, no problem to move it.)
> 

Hmm. I myself have no troubles whatever free vaule is used. 
let me clarify..

  xx00 0000
  xx11 1110 - swap count max
  01xx xxxx - swap has cache
  1xxx xxxx - swap count has continuation
  1x11 1111 - swap for shmem

seems not very bad.

Regards,
-Kame

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ