All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marcello Seri <marcello.seri@citrix.com>
To: Juergen Gross <jgross@suse.com>,
	Andrew Cooper <Andrew.Cooper3@citrix.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Christian Lindig <christian.lindig@citrix.com>
Subject: Re: [PATCH for-4.11 0/2] xenstore: reduce use of unsafe conversions
Date: Thu, 31 May 2018 16:41:08 +0000	[thread overview]
Message-ID: <1527784867028.7531@citrix.com> (raw)
In-Reply-To: <41bf43e5-0597-c796-b234-f64d8e682f85@suse.com>

On 31/05/18 17:29, Juergen Gross wrote:
>On 31/05/18 16:49, Andrew Cooper wrote:
>> On 31/05/18 15:14, Juergen Gross wrote:
>>> On 31/05/18 15:05, Marcello Seri wrote:
>>>> When xenstore was updated to support safe-string, some unnecessary
>>>> copies were introduced. A further patch reduced the copies at the price
>>>> of many calls to unsafe conversions between bytes and strings. In the
>>>> port we also did not notice that some C stubs were still incorrectly
>>>> using ocaml strings as mutable payload.
>>>>
>>>> This set of patches updates the C stubs that use mutable payloads passed
>>>> from ocaml, and reduces the amount of unsafe conversions where possible
>>>> without further increasing the number of copies.
>>>>
>>>> This seems also to fix some unclear instabilities that appeared after
>>>> the former patch introducing the unsafe conversion with some version of
>>>> the ocaml compiler.
>>> This is rather vague.

Unfortunately I don't know exactly what fixed the issue. My belief is that the first
patch fixed it. The second patch contains both changes to use the changes from
the first patch and changes to remove further uses of unsafe conversions.
I could try to test them separately, and see if the first plus a small part of the second is
enough, but I will no longer be able to access the test environment starting from
tomorrow as I am changing jobs and the tests are very slow to run.

>>> Can you confirm that oxenstored is now as stable as it was without the
>>> safe-string patches?
>>>
>>> Could you please mention the commit of the patch you are fixing in the
>>> related commit message? I'd like to know which of the two patches is
>>> the real fix and which is "only" some improvement of code.
>>>
>>> We are rather close to the release, so I'm hesitating to accept cleanup
>>> patches now.
>> So far, these changes do appear to have fixed the issues XenRT first
>> noticed.  Unfortunately the failures are very hard to quantify, but seem
>> to amount to "some operations seem to get dropped" (as there is no
>> obvious corruption), but the issues are rare and takes an large quantity
>> of machine hours to encounter.
> Did you try multiple concurrent runs of "xs-test -r <seconds>" to
> reproduce the problem? This has helped me a lot to find problems in
> xenstore.

No, I did not know about it. I will setup a machine with these changes
and test it. Thanks! Indeed, xs-test shows a failure on the unpatched
version.

>> I can't comment for exact changes, but the bug being fixed by patch 1 is
>> not passing a buffer (which the Ocaml runtime thinks is immutable) to
>> the C stubs to be written into.  AFAICT, it is consequence of the very
>> first attempt to move from mutable to immutable strings.

> So patch 2 is more kind of a cleanup? Or is it needed for the fix, too?

This is not just a cleanup, as it contains changes to adapt to the new xb interface.
I think it would be safer to include this patch anyways because it reduces the
calls to unsafe conversion functions, further reducing the surface for potential
issues.

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

  parent reply	other threads:[~2018-05-31 16:41 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-31 13:05 [PATCH for-4.11 0/2] xenstore: reduce use of unsafe conversions Marcello Seri
2018-05-31 13:05 ` [PATCH for-4.11 1/2] ocaml/libs/xb: use bytes in place of strings for mutable buffers Marcello Seri
2018-05-31 13:05 ` [PATCH for-4.11 2/2] ocaml/xenstored: reduce use of unsafe conversions Marcello Seri
2018-05-31 14:14 ` [PATCH for-4.11 0/2] xenstore: " Juergen Gross
2018-05-31 14:49   ` Andrew Cooper
2018-05-31 15:29     ` Juergen Gross
2018-05-31 15:49       ` Christian Lindig
2018-05-31 16:41       ` Marcello Seri [this message]
2018-06-01 18:54 ` Juergen Gross

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=1527784867028.7531@citrix.com \
    --to=marcello.seri@citrix.com \
    --cc=Andrew.Cooper3@citrix.com \
    --cc=christian.lindig@citrix.com \
    --cc=jgross@suse.com \
    --cc=xen-devel@lists.xenproject.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.