From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Andres Lagar-Cavilla" Subject: Re: [PATCH 2 of 4] x86/mm: Allow to not sleep on mem event ring Date: Fri, 17 Feb 2012 08:57:09 -0800 Message-ID: <9a1bf975f48e75e714a3128f19f43336.squirrel@webmail.lagarcavilla.org> References: <09746decbd28309ff25c.1329364625@xdev.gridcentric.ca> <20120216161114.GF41163@ocelot.phlegethon.org> Reply-To: andres@lagarcavilla.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20120216161114.GF41163@ocelot.phlegethon.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Tim Deegan Cc: andres@gridcentric.ca, xen-devel@lists.xensource.com, Andres Lagar-Cavilla , adin@gridcentric.ca List-Id: xen-devel@lists.xenproject.org > At 22:57 -0500 on 15 Feb (1329346625), Andres Lagar-Cavilla wrote: >> xen/arch/x86/mm/mem_event.c | 5 +++-- >> xen/include/asm-x86/mem_event.h | 30 +++++++++++++++++++++++++----- >> 2 files changed, 28 insertions(+), 7 deletions(-) >> >> >> Under extreme congestion conditions, generating a mem event may put the >> vcpu to >> sleep on a wait queue if the ring is full. This is generally desirable, >> although >> fairly convoluted to work with, since sleeping on a wait queue requires >> a >> non-atomic context (i.e. no locks held). >> >> Introduce an allow_sleep flag to make this optional. The API remains >> such that >> all current callers set allow_sleep to true and thus will sleep if >> necessary. >> >> The end-use is for cases in which loss of guest mem events is tolerable. >> One >> such consumer to be added later is the unsharing code under ENOMEM >> conditions. >> >> Signed-off-by: Andres Lagar-Cavilla >> Signed-off-by: Adin Scannell > > Hmm. This interface is getting a bit twisty now, but assuming the > patches that use it are OK, then Ack. Another option is to call a ring "best effort", and then the event producer doesn't have to specify whether sleep is allowable. The event producer should know, though, whether the ring is best effort. I think that makes up for a cleaner interface. Andres > > Tim. > >