All of lore.kernel.org
 help / color / mirror / Atom feed
* An issue in sharing the pages again in xen-memshare
@ 2018-07-23  2:37 sepanta s
  2018-07-23  7:22 ` Razvan Cojocaru
  0 siblings, 1 reply; 6+ messages in thread
From: sepanta s @ 2018-07-23  2:37 UTC (permalink / raw)
  To: xen-devel@lists.xen.org


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

Hi all,

I have written a program that can share memory pages of two VMs every x
milliseconds. To do so, I modified xen and added an unshare event to be
able to capture it. However,  for some pages, when I receive the unshare
event that contains the information about the pages which was about to be
written on and put it on a buffer for sharing them again after x
milliseconds, I cannot nominate them again and an error occurs. So, the
sharing mechanism I have built can partially share pages. I guess the
problem might be because of internal structure of sharing mechanism in the
Xen but can't figure out the problem.
Do you  have any idea what can cause this problem? Or what should I check
to get closer to any solution?


Thanks,
Sepanta

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

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

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

* Re: An issue in sharing the pages again in xen-memshare
  2018-07-23  2:37 An issue in sharing the pages again in xen-memshare sepanta s
@ 2018-07-23  7:22 ` Razvan Cojocaru
  2018-07-28  6:43   ` sepanta s
  0 siblings, 1 reply; 6+ messages in thread
From: Razvan Cojocaru @ 2018-07-23  7:22 UTC (permalink / raw)
  To: sepanta s, xen-devel@lists.xen.org, Tamas K Lengyel

On 07/23/2018 05:37 AM, sepanta s wrote:
> I have written a program that can share memory pages of two VMs every x
> milliseconds. To do so, I modified xen and added an unshare event to be
> able to capture it. However,  for some pages, when I receive the unshare
> event that contains the information about the pages which was about to
> be written on and put it on a buffer for sharing them again after x
> milliseconds, I cannot nominate them again and an error occurs. So, the
> sharing mechanism I have built can partially share pages. I guess the
> problem might be because of internal structure of sharing mechanism in
> the Xen but can't figure out the problem.
> Do you  have any idea what can cause this problem? Or what should I
> check to get closer to any solution?

I've never used this feature, but Tamas might have some insight into
this (added to Cc).

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

* Re: An issue in sharing the pages again in xen-memshare
  2018-07-23  7:22 ` Razvan Cojocaru
@ 2018-07-28  6:43   ` sepanta s
  2018-08-24  5:07     ` sepanta s
  0 siblings, 1 reply; 6+ messages in thread
From: sepanta s @ 2018-07-28  6:43 UTC (permalink / raw)
  To: Razvan Cojocaru; +Cc: tamas.lengyel, xen-devel@lists.xen.org


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

Thanks.
I would be thankful if he can help me ...

On Mon, Jul 23, 2018 at 11:52 AM Razvan Cojocaru <rcojocaru@bitdefender.com>
wrote:

> On 07/23/2018 05:37 AM, sepanta s wrote:
> > I have written a program that can share memory pages of two VMs every x
> > milliseconds. To do so, I modified xen and added an unshare event to be
> > able to capture it. However,  for some pages, when I receive the unshare
> > event that contains the information about the pages which was about to
> > be written on and put it on a buffer for sharing them again after x
> > milliseconds, I cannot nominate them again and an error occurs. So, the
> > sharing mechanism I have built can partially share pages. I guess the
> > problem might be because of internal structure of sharing mechanism in
> > the Xen but can't figure out the problem.
> > Do you  have any idea what can cause this problem? Or what should I
> > check to get closer to any solution?
>
> I've never used this feature, but Tamas might have some insight into
> this (added to Cc).
>

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

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

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

* Re: An issue in sharing the pages again in xen-memshare
  2018-07-28  6:43   ` sepanta s
@ 2018-08-24  5:07     ` sepanta s
  2018-08-24  9:49       ` Razvan Cojocaru
  0 siblings, 1 reply; 6+ messages in thread
From: sepanta s @ 2018-08-24  5:07 UTC (permalink / raw)
  To: Razvan Cojocaru; +Cc: Tamas Lengyel, xen-devel@lists.xen.org


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

Hi again,

I debugged the kernel codes and found out the root cause.
The sharing is not done for some pages causing error -E2BIG which is due to
reference count being more than one. This prevents hypervor to nominate the
page. As much as I know about this issue, the page that I want to nominate
and I receive this error from make_page_sharable function in mem_sharing.c
is pointed by more than one pages. So, is there any idea to resolve this
issue? I though that I can put the page number in a buffer and share it
again after t milliseconds but still the nomination return -E2BIG error.
Am I missing something?

I would be grateful if you could help.


On Sat, Jul 28, 2018 at 11:13 AM sepanta s <sapanta992@gmail.com> wrote:

> Thanks.
> I would be thankful if he can help me ...
>
> On Mon, Jul 23, 2018 at 11:52 AM Razvan Cojocaru <
> rcojocaru@bitdefender.com> wrote:
>
>> On 07/23/2018 05:37 AM, sepanta s wrote:
>> > I have written a program that can share memory pages of two VMs every x
>> > milliseconds. To do so, I modified xen and added an unshare event to be
>> > able to capture it. However,  for some pages, when I receive the unshare
>> > event that contains the information about the pages which was about to
>> > be written on and put it on a buffer for sharing them again after x
>> > milliseconds, I cannot nominate them again and an error occurs. So, the
>> > sharing mechanism I have built can partially share pages. I guess the
>> > problem might be because of internal structure of sharing mechanism in
>> > the Xen but can't figure out the problem.
>> > Do you  have any idea what can cause this problem? Or what should I
>> > check to get closer to any solution?
>>
>> I've never used this feature, but Tamas might have some insight into
>> this (added to Cc).
>>
>

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

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

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

* Re: An issue in sharing the pages again in xen-memshare
  2018-08-24  5:07     ` sepanta s
@ 2018-08-24  9:49       ` Razvan Cojocaru
       [not found]         ` <CABaiLQ-y7JjRiNz2+kBVfmkcSFbevRgZCpuHo=pWY9B77OV4pA@mail.gmail.com>
  0 siblings, 1 reply; 6+ messages in thread
From: Razvan Cojocaru @ 2018-08-24  9:49 UTC (permalink / raw)
  To: sepanta s; +Cc: Tamas Lengyel, xen-devel@lists.xen.org

On 8/24/18 8:07 AM, sepanta s wrote:
> I debugged the kernel codes and found out the root cause.
> The sharing is not done for some pages causing error -E2BIG which is due
> to reference count being more than one. This prevents hypervor to
> nominate the page. As much as I know about this issue, the page that I
> want to nominate and I receive this error from make_page_sharable
> function in mem_sharing.c is pointed by more than one pages. So, is
> there any idea to resolve this issue? I though that I can put the page
> number in a buffer and share it again after t milliseconds but still the
> nomination return -E2BIG error.  Am I missing something?

As stated before, unfortunately I've never used this feature and don't
know what to suggest. Again, maybe Tamas will chime in.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

* Re: An issue in sharing the pages again in xen-memshare
       [not found]                     ` <CABaiLQ9B00dsmSbCs28-2SRoZHudkQTjMbfdZ4Eha-WRVONu1Q@mail.gmail.com>
@ 2018-10-06 14:24                       ` Tamas Lengyel
  0 siblings, 0 replies; 6+ messages in thread
From: Tamas Lengyel @ 2018-10-06 14:24 UTC (permalink / raw)
  To: sepanta s, Xen-devel

Hi Sepanta,
memsharing in Xen is fairly rough around the edges. Not being able to
share all pages between VMs is normal though.  Last time I checked you
could still share a fairly large chunk of memory between a VM and its
clone created via save/restore. Just keep in mind that the origin VM
can't be unpaused after its memory is shared to a clone and that the
clone also needs a CoW disk. If you really believe the page you are
trying to share should be sharable you will need to debug it further
on your own and submit a patch with a fix that I would be happy to
review.

Tamas

On Fri, Oct 5, 2018 at 11:26 PM sepanta s <sapanta992@gmail.com> wrote:
>
>
> Dear Tamas,
>
> I have got consecutive problem in memory sharing in Xen. I would be so much grateful if you could give me a hand.
>
> Firstly, I have written a user-level application that deduplicates unshared pages after T miliseconds. The problem with this application is that it can't share all the pages even though the pages are numerous. As I went through debugging the Xen code, I figured out that reference count of those pages were negative. So, by searching more I got that an overflow occurs for those pages in that part of my Xen version 4.7.
> I decided to migrate to a newer stable release, which I chose 4.11. In that version, I created a raw image, installed my windows and run the virtual machine. Then, I created a clone of the vm. I paused both the source and its clone and tried to run memsharetool to share pages between the source and the clone. Here, the Xen host hangs and I cannot do anything. I reported the problem as a bug or something similar to Xen mailing list.  I asked Razvan, he told me to debug and send the report but my PC doesn't have a serial port. As the other PCs I have access to do not have serial ports, I tried to install Xen in a VM in Vbox to use the emulated serial ports to debug from another Vbox VM. But, that comes other problems as I cannot create VM in Xen 4.11 in ubuntu 17.04 as dom0.
>
> You know I am just moving from one problem  to another. I just need your help.
> I am looking forward to hearing from you soon.
>
>
> With Regards,
> Sepanta
>
> ---------- Forwarded message ---------
> From: sepanta s <sapanta992@gmail.com>
> Date: Mon, Sep 17, 2018 at 8:13 AM
> Subject: Re: [Xen-devel] An issue in sharing the pages again in xen-memshare
> To: Razvan Cojocaru <rcojocaru@bitdefender.com>
>
>
> Thanks a lot!
>
> On Sun, Sep 16, 2018 at 6:10 PM Razvan Cojocaru <rcojocaru@bitdefender.com> wrote:
>>
>> Hello,
>>
>> I don't know what the problem might be (as mentioned before, I've done
>> no work at all with memsharing). However, to see why your host hangs you
>> should use a serial port connection to another computer and see if
>> there's a backtrace.
>>
>> https://wiki.xenproject.org/wiki/Xen_Serial_Console
>> https://wiki.xenproject.org/wiki/Debugging_Xen
>>
>> I think your best bet is Tamas - if he's got time to help.
>>
>>
>> Good luck,
>> Razvan
>>
>> On 9/16/18 12:05 PM, sepanta s wrote:
>> > Hi Razvan,
>> >
>> > I checked through the problem I mentioned before. The problem was due to
>> > a vulnerability in reference counters in Xen 4.9. I compiled the last
>> > release of Xen 4.9 as I checked the patches had been applied.
>> > But a new problem arises from something else. You know, before I want to
>> > share the memory of two VMs, I create one and then create a clone of it
>> > with save/restore. Then I use "range" option in memsharetool in Xen to
>> > share the pages, but the host hangs. I guess there is a bug in Xen in
>> > sharing two VMs which one has been created via save/restoring. I checked
>> > this for Xen 4.11 with Ubuntu 17.04 as host and Windows 7 as guest.
>> > Can you help me or should I post this on the Xen developers mailing list?'
>> >
>> > I look forward to hearing from you.
>> >
>> > P.S: I am Phd student and this is my Master's project which was not
>> > implemented. I am working on it on and off but want to finish it. That's
>> > why there is long period of time between each question . Just thought
>> > being on and off is not really good! So, I shared the reason with you.
>> >
>> > With Regards,
>> > Sepanta
>> >
>> >
>> >
>> >
>> > On Fri, Aug 24, 2018 at 2:29 PM sepanta s <sapanta992@gmail.com
>> > <mailto:sapanta992@gmail.com>> wrote:
>> >
>> >     Thanks.
>> >
>> >     On Fri, Aug 24, 2018 at 2:40 PM Razvan Cojocaru
>> >     <rcojocaru@bitdefender.com <mailto:rcojocaru@bitdefender.com>> wrote:
>> >
>> >         No problem, I was just trying to clear things up.
>> >
>> >         Good luck with the debugging!
>> >
>> >         On 8/24/18 8:31 AM, sepanta s wrote:
>> >         > Thanks for your reply, I understand.
>> >         > Unfortunately, He didn't reply the previous one and I am stuck in.
>> >         > I will not reply the email to you again.
>> >         >
>> >         > Sorry.
>> >         >
>> >         > On Fri, Aug 24, 2018 at 2:19 PM Razvan Cojocaru
>> >         > <rcojocaru@bitdefender.com <mailto:rcojocaru@bitdefender.com>
>> >         <mailto:rcojocaru@bitdefender.com
>> >         <mailto:rcojocaru@bitdefender.com>>> wrote:
>> >         >
>> >         >     On 8/24/18 8:07 AM, sepanta s wrote:
>> >         >     > I debugged the kernel codes and found out the root cause.
>> >         >     > The sharing is not done for some pages causing error
>> >         -E2BIG which
>> >         >     is due
>> >         >     > to reference count being more than one. This prevents
>> >         hypervor to
>> >         >     > nominate the page. As much as I know about this issue,
>> >         the page that I
>> >         >     > want to nominate and I receive this error from
>> >         make_page_sharable
>> >         >     > function in mem_sharing.c is pointed by more than one
>> >         pages. So, is
>> >         >     > there any idea to resolve this issue? I though that I
>> >         can put the page
>> >         >     > number in a buffer and share it again after t
>> >         milliseconds but
>> >         >     still the
>> >         >     > nomination return -E2BIG error.  Am I missing something?
>> >         >
>> >         >     As stated before, unfortunately I've never used this
>> >         feature and don't
>> >         >     know what to suggest. Again, maybe Tamas will chime in.
>> >         >
>> >
>>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

end of thread, other threads:[~2018-10-06 14:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-23  2:37 An issue in sharing the pages again in xen-memshare sepanta s
2018-07-23  7:22 ` Razvan Cojocaru
2018-07-28  6:43   ` sepanta s
2018-08-24  5:07     ` sepanta s
2018-08-24  9:49       ` Razvan Cojocaru
     [not found]         ` <CABaiLQ-y7JjRiNz2+kBVfmkcSFbevRgZCpuHo=pWY9B77OV4pA@mail.gmail.com>
     [not found]           ` <ef7f95fe-bbc0-bdd9-d9ae-f0324d6e87b0@bitdefender.com>
     [not found]             ` <CABaiLQ9D-g4WziFbE-3kecLae539qvAeMW2u7kz1hDo0u7YNbA@mail.gmail.com>
     [not found]               ` <CABaiLQ-hkSzjFRv-SRh=Tt6z01ynFT-RKWPGtuSDFPHghtFFWg@mail.gmail.com>
     [not found]                 ` <990b64a3-d797-09d1-6f91-2c87bb799223@bitdefender.com>
     [not found]                   ` <CABaiLQ8SO7iXA6wMMbCaXEUZNC8rr=f8EkomWCXzQ+b1-qXDWw@mail.gmail.com>
     [not found]                     ` <CABaiLQ9B00dsmSbCs28-2SRoZHudkQTjMbfdZ4Eha-WRVONu1Q@mail.gmail.com>
2018-10-06 14:24                       ` Tamas Lengyel

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.