linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Lameter <clameter@engr.sgi.com>
To: Andi Kleen <ak@suse.de>
Cc: linux-kernel@vger.kernel.org, Hugh Dickins <hugh@veritas.com>,
	Nick Piggin <nickpiggin@yahoo.com.au>,
	linux-mm@kvack.org,
	Marcelo Tosatti <marcelo.tosatti@cyclades.com>
Subject: Re: [RFC 1/6] Framework
Date: Mon, 12 Dec 2005 08:32:49 -0800 (PST)	[thread overview]
Message-ID: <Pine.LNX.4.62.0512120827470.14274@schroedinger.engr.sgi.com> (raw)
In-Reply-To: <20051210033235.GP11190@wotan.suse.de>

On Sat, 10 Dec 2005, Andi Kleen wrote:

> > +#define global_page_state(__x) atomic_long_read(&vm_stat[__x])
> > +#define zone_page_state(__z,__x) atomic_long_read(&(__z)->vm_stat[__x])
> > +extern unsigned long node_page_state(int node, enum zone_stat_item);
> > +
> > +/*
> > + * For use when we know that interrupts are disabled.
> 
> Why do you need to disable interupts for atomic_t ? 

Interrupts need to be disabled because the processing of the byte sized 
differential could be interrupted.

> If you just want to prevent switching CPUs that could be 
> done with get_cpu(), but alternatively you could just ignore
> that race (it wouldn't be a big issue to still increment
> the counter on the old CPU)

There is no increment or decrement right now. We add an offset and that 
offset could easily burst the limits of a byte sized differential. A check 
needs to happen before the differential is updated.

> And why atomic and not just local_t?  On x86/x86-64 local_t
> would be much cheaper at least. It's not long, but that could
> be as well added.

local_t is long on ia64. 

The atomics are used for global updates of counters in struct zone and the 
vm_stats array. local_t wont help there.

local_t could be used for the differentials. Special functions for 
increment and decrement could use the non-interruptible nature of inc/decs 
on i386 and x86_64.

There is no byte sized local_t though so its difficult to use local_t 
here. I think this whole local_t stuff is not too useful after all. 
Could we add an incp/decp macro that is like cmpxchg? That macro should 
be able to operation on various sizes of counters.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2005-12-12 16:32 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-10  0:54 [RFC 0/6] Zoned VM stats Christoph Lameter
2005-12-10  0:54 ` [RFC 1/6] Framework Christoph Lameter
2005-12-10  3:32   ` Andi Kleen
2005-12-12 16:32     ` Christoph Lameter [this message]
2005-12-12  3:46   ` Nick Piggin
2005-12-12  3:56     ` Andi Kleen
2005-12-12  4:14       ` Nick Piggin
2005-12-12  4:21         ` Andi Kleen
2005-12-12  4:28           ` Nick Piggin
2005-12-12  4:51             ` Andi Kleen
2005-12-12  7:05               ` Nick Piggin
2005-12-10  0:54 ` [RFC 2/6] Make nr_mapped a per zone counter Christoph Lameter
2005-12-10  0:54 ` [RFC 3/6] Make nr_pagecache " Christoph Lameter
2005-12-11 18:32   ` Marcelo Tosatti
2005-12-11 19:48     ` Andi Kleen
2005-12-11 20:49       ` Marcelo Tosatti
2005-12-12  3:51         ` Nick Piggin
2005-12-12 11:57           ` Marcelo Tosatti
2005-12-12 16:34             ` Christoph Lameter
2005-12-10  0:55 ` [RFC 4/6] Expanded node and zone statistics Christoph Lameter
2005-12-10  0:55 ` [RFC 5/6] Make nr_slab a per zone counter Christoph Lameter
2005-12-10  0:55 ` [RFC 6/6] Make nr_pagecache " Christoph Lameter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.62.0512120827470.14274@schroedinger.engr.sgi.com \
    --to=clameter@engr.sgi.com \
    --cc=ak@suse.de \
    --cc=hugh@veritas.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=marcelo.tosatti@cyclades.com \
    --cc=nickpiggin@yahoo.com.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox