public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Akshay Karle <akshay.a.karle@gmail.com>
To: Dan Magenheimer <dan.magenheimer@oracle.com>
Cc: Konrad Wilk <konrad.wilk@oracle.com>,
	linux-kernel@vger.kernel.org, kvm@vger.kernel.org,
	ashu tripathi <er.ashutripathi@gmail.com>,
	nishant gulhane <nishant.s.gulhane@gmail.com>,
	Shreyas Mahure <shreyas.mahure@gmail.com>,
	amarmore2006 <amarmore2006@gmail.com>,
	mahesh mohan <mahesh6490@gmail.com>
Subject: RE: [RFC 1/2] kvm: host-side changes for tmem on KVM
Date: Sat, 17 Mar 2012 23:32:55 +0530	[thread overview]
Message-ID: <1332007375.2110.8.camel@aks> (raw)
In-Reply-To: <33e296c5-825f-44a2-8f42-e76caf3715a6@default>

> > From: Akshay Karle [mailto:akshay.a.karle@gmail.com]
> > Subject: Re: [RFC 1/2] kvm: host-side changes for tmem on KVM
> > 
> > >> @@ -669,7 +670,6 @@ static struct zv_hdr *zv_create(struct x
> > >>       int chunks = (alloc_size + (CHUNK_SIZE - 1)) >> CHUNK_SHIFT;
> > >>       int ret;
> > >>
> > >> -     BUG_ON(!irqs_disabled());
> > > 
> > > Can you explain why?
> >
> > Zcache is by default used in the non-virtualized environment for page compression. Whenever
> > a page is to be evicted from the page cache the spin_lock_irq is held on the page mapping.
> > To ensure that this is done, the BUG_ON(!irqs_disabled()) was used.
> > But now the situation is different, we are using zcache functions for kvm VM's.
> > So if any page of the guest is to be evicted the irqs should be disabled in just that
> > guest and not the host, so we removed the BUG_ON(!irqs_disabled()); line.
>
> I think irqs may still need to be disabled (in your code by the caller)
> since the tmem code (in tmem.c) takes spinlocks with this assumption.
> I'm not sure since I don't know what can occur with scheduling a
> kvm guest during an interrupt... can a different vcpu of the same guest
> be scheduled on this same host pcpu?
> 
> Dan

The irqs are disabled but only in the guest kernel not in the host. We 
tried adding the spin_lock_irq code into the host but that was resulting
in host panic as the lock is being taken on the entire mapping. If the
irqs are disabled in the guest, is there a need to disable them on the
host as well? Because the mappings maybe different in the host and the
guest.

  reply	other threads:[~2012-03-17 18:02 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-08 16:54 [RFC 1/2] kvm: host-side changes for tmem on KVM Akshay Karle
2012-03-08 17:37 ` Bobby Powers
2012-03-15 16:54 ` Konrad Rzeszutek Wilk
2012-03-15 18:41   ` Akshay Karle
2012-03-15 19:44     ` Dan Magenheimer
2012-03-15 19:51     ` Dan Magenheimer
2012-03-17 18:02       ` Akshay Karle [this message]
2012-03-18 19:52         ` Dan Magenheimer

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=1332007375.2110.8.camel@aks \
    --to=akshay.a.karle@gmail.com \
    --cc=amarmore2006@gmail.com \
    --cc=dan.magenheimer@oracle.com \
    --cc=er.ashutripathi@gmail.com \
    --cc=konrad.wilk@oracle.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mahesh6490@gmail.com \
    --cc=nishant.s.gulhane@gmail.com \
    --cc=shreyas.mahure@gmail.com \
    /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