Kernel Newbies archive on lore.kernel.org
 help / Atom feed
* Partition linux page cache for each VM
@ 2019-04-25 13:36 Chirag Chauhan
  2019-04-25 17:27 ` Greg KH
  0 siblings, 1 reply; 5+ messages in thread
From: Chirag Chauhan @ 2019-04-25 13:36 UTC (permalink / raw)
  To: kernelnewbies

[-- Attachment #1.1: Type: text/plain, Size: 741 bytes --]

Hey,

I need to modify pagecache such that each VM gets their own LRU list and
eviction is done from that list.
I need to verify whether I'm on the right path, so can anyone please verify
my approach.

The first step is to identify which VM is making the call to allocate a
page.
As VMs are stored as a file, I can identify each VM with their filename,
right?
For this, I'm trying to get the filename associated with an address_space
object when add_to_page_cache_lru() is called in filemap.c

From address_space object, I can get inode and therefore dentry.
I'm not able to figure out how to get the name of a file.

And can you please provide brief overview of what the overall approach
should be?
Any comments would help.

Thanks.
Chirag

[-- Attachment #1.2: Type: text/html, Size: 1008 bytes --]

<div dir="ltr"><div dir="ltr"><div dir="ltr"><div>Hey,</div><div><br></div><div>I need to modify pagecache such that each VM gets their own LRU list and eviction is done from that list.</div><div>I need to verify whether I&#39;m on the right path, so can anyone please verify my approach.</div><div><br></div><div>The first step is to identify which VM is making the call to allocate a page.</div><div>As VMs are stored as a file, I can identify each VM with their filename, right?</div><div>For this, I&#39;m trying to get the filename associated with an address_space object when add_to_page_cache_lru() is called in filemap.c</div><div><br></div><div>From address_space object, I can get inode and therefore dentry.</div><div>I&#39;m not able to figure out how to get the name of a file.</div><div><br></div><div>And can you please provide brief overview of what the overall approach should be?</div><div>Any comments would help.</div><div><br></div><div>Thanks.</div><div>Chirag</div></div></div></div>

[-- Attachment #2: Type: text/plain, Size: 170 bytes --]

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Partition linux page cache for each VM
  2019-04-25 13:36 Partition linux page cache for each VM Chirag Chauhan
@ 2019-04-25 17:27 ` Greg KH
  2019-04-25 21:31   ` Chirag Chauhan
  0 siblings, 1 reply; 5+ messages in thread
From: Greg KH @ 2019-04-25 17:27 UTC (permalink / raw)
  To: Chirag Chauhan; +Cc: kernelnewbies

On Thu, Apr 25, 2019 at 07:06:54PM +0530, Chirag Chauhan wrote:
> Hey,
> 
> I need to modify pagecache such that each VM gets their own LRU list and
> eviction is done from that list.

Odd, please step back, why have you determined that this is something
that you have to do?  Were you told to do this by someone?  Is this a
homework assignment?  What problems are you thinking that this might
help with?

And please define "VM" here, what exactly is that?  A KVM image?  Xen?
Hyper-V?  Something else?

thanks,

greg k-h

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Partition linux page cache for each VM
  2019-04-25 17:27 ` Greg KH
@ 2019-04-25 21:31   ` Chirag Chauhan
  2019-04-26  2:08     ` Valdis Klētnieks
  2019-04-26  6:23     ` Greg KH
  0 siblings, 2 replies; 5+ messages in thread
From: Chirag Chauhan @ 2019-04-25 21:31 UTC (permalink / raw)
  To: Greg KH; +Cc: kernelnewbies

[-- Attachment #1.1: Type: text/plain, Size: 807 bytes --]

On Thu, Apr 25, 2019 at 10:57 PM Greg KH <greg@kroah.com> wrote:

> On Thu, Apr 25, 2019 at 07:06:54PM +0530, Chirag Chauhan wrote:
> > Hey,
> >
> > I need to modify pagecache such that each VM gets their own LRU list and
> > eviction is done from that list.
>
> Odd, please step back, why have you determined that this is something
> that you have to do?  Were you told to do this by someone?  Is this a
> homework assignment?  What problems are you thinking that this might
> help with?

I have selected this as a course project for a course on virtualization.
Doing this will reduce the performance interference between virtual
machines.


> And please define "VM" here, what exactly is that?  A KVM image?  Xen?
> Hyper-V?  Something else?
>
Yes, a KVM image.

>
> thanks,
>
> greg k-h
>

Thank you.

>

[-- Attachment #1.2: Type: text/html, Size: 1957 bytes --]

<div dir="auto"><div dir="ltr"><div><br></div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Apr 25, 2019 at 10:57 PM Greg KH &lt;<a href="mailto:greg@kroah.com" target="_blank" rel="noreferrer">greg@kroah.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">On Thu, Apr 25, 2019 at 07:06:54PM +0530, Chirag Chauhan wrote:<br>
&gt; Hey,<br>
&gt; <br>
&gt; I need to modify pagecache such that each VM gets their own LRU list and<br>
&gt; eviction is done from that list.<br>
<br>
Odd, please step back, why have you determined that this is something<br>
that you have to do?  Were you told to do this by someone?  Is this a<br>
homework assignment?  What problems are you thinking that this might<br>
help with?</blockquote><div>I have selected this as a course project for a course on virtualization.</div><div dir="auto">Doing this will reduce the performance interference between virtual machines.</div><div dir="auto"><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
<br>
And please define &quot;VM&quot; here, what exactly is that?  A KVM image?  Xen?<br>
Hyper-V?  Something else?<br></blockquote><div>Yes, a KVM image. </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
<br>
thanks,<br>
<br>
greg k-h<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">Thank you.</div><div dir="ltr"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
</blockquote></div></div></div>

[-- Attachment #2: Type: text/plain, Size: 170 bytes --]

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Partition linux page cache for each VM
  2019-04-25 21:31   ` Chirag Chauhan
@ 2019-04-26  2:08     ` Valdis Klētnieks
  2019-04-26  6:23     ` Greg KH
  1 sibling, 0 replies; 5+ messages in thread
From: Valdis Klētnieks @ 2019-04-26  2:08 UTC (permalink / raw)
  To: Chirag Chauhan; +Cc: Greg KH, kernelnewbies

On Fri, 26 Apr 2019 03:01:52 +0530, Chirag Chauhan said:

> I have selected this as a course project for a course on virtualization.
> Doing this will reduce the performance interference between virtual
> machines.

Actually, it can make it worse.

Consider the behavior of 4 VMs sharing 16G of page cache, where
3 VMs want 4.5G of cache each and 1 wants 2G.

Now consider the behavior of 4 VMs each with a guaranteed 4G of page
cache, where 3 VMs want 4.5G of cache each and 1 wants 2G.

Then perform the same analysis for your LRU list, and make sure it actually
provides a benefit before you start coding.....

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Partition linux page cache for each VM
  2019-04-25 21:31   ` Chirag Chauhan
  2019-04-26  2:08     ` Valdis Klētnieks
@ 2019-04-26  6:23     ` Greg KH
  1 sibling, 0 replies; 5+ messages in thread
From: Greg KH @ 2019-04-26  6:23 UTC (permalink / raw)
  To: Chirag Chauhan; +Cc: kernelnewbies

On Fri, Apr 26, 2019 at 03:01:52AM +0530, Chirag Chauhan wrote:
> On Thu, Apr 25, 2019 at 10:57 PM Greg KH <greg@kroah.com> wrote:
> 
> > On Thu, Apr 25, 2019 at 07:06:54PM +0530, Chirag Chauhan wrote:
> > > Hey,
> > >
> > > I need to modify pagecache such that each VM gets their own LRU list and
> > > eviction is done from that list.
> >
> > Odd, please step back, why have you determined that this is something
> > that you have to do?  Were you told to do this by someone?  Is this a
> > homework assignment?  What problems are you thinking that this might
> > help with?
> 
> I have selected this as a course project for a course on virtualization.

Great!  Do we get credit for this as well?  Be sure to let your
professor know that random people on the internet contributed to your
grade :)

Good luck, you are on your own here, sorry.

> Doing this will reduce the performance interference between virtual
> machines.

I really doubt it will, but hey, that's what research is for!  :)

greg k-h

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, back to index

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-25 13:36 Partition linux page cache for each VM Chirag Chauhan
2019-04-25 17:27 ` Greg KH
2019-04-25 21:31   ` Chirag Chauhan
2019-04-26  2:08     ` Valdis Klētnieks
2019-04-26  6:23     ` Greg KH

Kernel Newbies archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/kernelnewbies/0 kernelnewbies/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 kernelnewbies kernelnewbies/ https://lore.kernel.org/kernelnewbies \
		kernelnewbies@kernelnewbies.org kernelnewbies@archiver.kernel.org
	public-inbox-index kernelnewbies


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernelnewbies.kernelnewbies


AGPL code for this site: git clone https://public-inbox.org/ public-inbox