mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Bas Westerbaan" <bas.westerbaan@gmail.com>
To: "Martin J. Bligh" <mbligh@mbligh.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Conveying memory pressure to userspace?
Date: Fri, 11 May 2007 12:00:30 +0200	[thread overview]
Message-ID: <6880bed30705110300i77033b7bgc111b0e165b78097@mail.gmail.com> (raw)
In-Reply-To: <4643CCDF.7060608@mbligh.org>

> The prev_priority field in the zoneinfo stuff is more useful for
> memory pressure. I'm playing with making a blocking callback that
> can wake someone up when this gets down to a certain priority level
> (prio=12 => everything's rosy, prio=0 => we're in deep shit).

Ah, I see.  This, however, doesn't make sharing fair yet.

Take for instance two SQL servers.  Both want as much cache.  At a
certain moment they'll both have allocated just enough to keep the
last_priority to a constant.

When one has a slightly lesser constant than the other, that one will
keep allocating to get it down to that value whereas the other will
keep freeing to get up to his constant.

Even when they've got the same pressure they strive for then when some
pressure is releaved, it's first come first serve, which isn't really
fair.



Let applications register the amount of cache they are using (proc
entry, new madvise flag?) and let them register a priority.  Then the
kernel will keep track of a factor of fairness (<1: not greedy enough;
1> too greedy.)[1].  What about adding a callback when this value
deviates a certain amount (<0.8, >1.2)?



-- 
Bas Westerbaan
GPG 99BA289B | SINP bas@w-nz.com
http://blog.w-nz.com/

  reply	other threads:[~2007-05-11 10:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-11  0:56 Bas Westerbaan
2007-05-11  1:54 ` Martin J. Bligh
2007-05-11 10:00   ` Bas Westerbaan [this message]
2007-05-11 17:05 ` Christoph Lameter
2007-05-11 20:48   ` Paul Jackson

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=6880bed30705110300i77033b7bgc111b0e165b78097@mail.gmail.com \
    --to=bas.westerbaan@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mbligh@mbligh.org \
    /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

all inboxes | Powered by JetHome®