From: Pavel Emelyanov <xemul-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org>
To: Paul Menage <menage-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
Cc: yamamoto-jCdQPDEk3idL9jVzuh4AOg@public.gmane.org,
nishimura-YQH0OdQVrdy45+QrQBaojngSJqDPrsil@public.gmane.org,
containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org,
balbir-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org
Subject: Re: [RFC][PATCH 2/4] res_counter check usage under val
Date: Wed, 30 Jul 2008 16:34:53 +0400 [thread overview]
Message-ID: <48905FED.9090909@openvz.org> (raw)
In-Reply-To: <6599ad830807300441w5b1c149dg7dc0f4eb521439e7-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
Paul Menage wrote:
> On Tue, Jul 29, 2008 at 7:09 PM, Pavel Emelyanov <xemul-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org> wrote:
>>> I get your point. Logically this lock is unnecessary.
>>> (And seems this patch itself is buggy..(maybe refresh miss))
>>>
>>> BTW, I'm sorry if I misunderstand. unsigned long long (on x86-32)
>>> can be compared safely ?
>> Oops... Indeed.
>> That discourages me, that we need a spinlock for simple comparisons :(
>>
>
> We could add a function to read a res_counter that only takes a
> spinlock on architectures where a 64-bit value can't be read
> atomically.
Agree.
BTW, I think it's a good candidate for some generic, I don't know, data
type? Or some helper like arch_prepare_long_read(), that is void on 64
bit ones and some variant of seqcount (*count*, not seq*lock*) for 32.
> Also, for values that are monotonically increasing, I think it should
> be possible to read a 64-bit value without locking by checking that
> reading the value twice either side of an appropriate memory value
> returns the same result both times.
>
> Paul
>
next prev parent reply other threads:[~2008-07-30 12:34 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-18 10:31 [RFC][PATCH 0/4[ memcg shrinking usage KAMEZAWA Hiroyuki
[not found] ` <20080718193123.cf74b574.kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
2008-07-18 10:34 ` [RFC][PATCH 1/4] res_counter set_limit and -EBUSY KAMEZAWA Hiroyuki
[not found] ` <20080718193437.ae79478a.kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
2008-07-21 17:32 ` Pavel Emelyanov
2008-07-18 10:35 ` [RFC][PATCH 2/4] res_counter check usage under val KAMEZAWA Hiroyuki
[not found] ` <20080718193530.578fb1e3.kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
2008-07-21 17:41 ` Pavel Emelyanov
[not found] ` <4884CA4F.9060003-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org>
2008-07-28 8:28 ` kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A
[not found] ` <26133366.1217233738316.kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org>
2008-07-30 2:09 ` Pavel Emelyanov
[not found] ` <488FCD42.4090309-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org>
2008-07-30 11:41 ` Paul Menage
[not found] ` <6599ad830807300441w5b1c149dg7dc0f4eb521439e7-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-07-30 12:34 ` Pavel Emelyanov [this message]
2008-07-18 10:36 ` [RFC][PATCH 3/4] memcg shrink usage at limit change KAMEZAWA Hiroyuki
2008-07-18 10:37 ` [RFC][PATCH 4/4] memcg shrinking usage KAMEZAWA Hiroyuki
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=48905FED.9090909@openvz.org \
--to=xemul-gefaqzzx7r8dnm+yrofe0a@public.gmane.org \
--cc=balbir-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org \
--cc=containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org \
--cc=menage-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
--cc=nishimura-YQH0OdQVrdy45+QrQBaojngSJqDPrsil@public.gmane.org \
--cc=yamamoto-jCdQPDEk3idL9jVzuh4AOg@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.