public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Stanislav Kinsbursky <skinsbursky@parallels.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: "akpm@linux-foundation.org" <akpm@linux-foundation.org>,
	"criu@openvz.org" <criu@openvz.org>,
	"lucas.demarchi@profusion.mobi" <lucas.demarchi@profusion.mobi>,
	"dhowells@redhat.com" <dhowells@redhat.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"serge.hallyn@canonical.com" <serge.hallyn@canonical.com>
Subject: Re: [PATCH] IPC: message queue stealing feature introduced
Date: Wed, 15 Feb 2012 19:02:20 +0400	[thread overview]
Message-ID: <4F3BC8FC.5000806@parallels.com> (raw)
In-Reply-To: <1329298813.2437.5.camel@edumazet-HP-Compaq-6005-Pro-SFF-PC>

15.02.2012 13:40, Eric Dumazet пишет:
> Le mercredi 15 février 2012 à 13:08 +0400, Stanislav Kinsbursky a
> écrit :
>> This patch is required for checkpoint/restore in userspace project.
>> C/r requires some way to get all pending IPC messages without deleting them for
>> the queue (checkpoint can fail and in this case tasks will be resumed, so queue
>> have to be valid).
>> To achive this, new operation flag MSG_STEAL for sys_msgrcv() system call
>> introduced.
>> If this flag is set, then passed struct msgbuf pointer will be used for storing
>> array of structures:
>>
>> struct msgbuf_a {
>> 	long mtype;         /* type of message */
>> 	size_t msize;       /* size of message */
>> 	char mtext[0];      /* message text */
>> };
>>
>
> This structure is not 32/64 bit safe and will need compat tricks.
>
> +                       ret = do_steal_msg(mtext, arrsz, msg);
> +                       if (ret<  0) {
> +                               msg = ERR_PTR(ret);
> +                               goto out_unlock;
> +                       }
> +                       mtext += ret + sizeof(struct msgbuf_a);
> +                       arrsz -= ret + sizeof(struct msgbuf_a);
>
> I cant see where alignement requirements are met.
>
> (ret should be rounded up to a multiple of alignof(struct msgbuf_a)
>


Thanks for reply, Eric.
Will fix and resend soon.

-- 
Best regards,
Stanislav Kinsbursky

      reply	other threads:[~2012-02-15 15:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-15  9:08 [PATCH] IPC: message queue stealing feature introduced Stanislav Kinsbursky
2012-02-15  9:40 ` Eric Dumazet
2012-02-15 15:02   ` Stanislav Kinsbursky [this message]

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=4F3BC8FC.5000806@parallels.com \
    --to=skinsbursky@parallels.com \
    --cc=akpm@linux-foundation.org \
    --cc=criu@openvz.org \
    --cc=dhowells@redhat.com \
    --cc=eric.dumazet@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lucas.demarchi@profusion.mobi \
    --cc=serge.hallyn@canonical.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