From: Keir Fraser <keir.xen@gmail.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: Jisoo Yang <jisooy@gmail.com>, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [PATCH] fix page_list_splice()
Date: Wed, 06 Jun 2012 12:22:07 +0100 [thread overview]
Message-ID: <CBF4FBEF.3558E%keir.xen@gmail.com> (raw)
In-Reply-To: <4FCF3E5002000078000886D7@nat28.tlf.novell.com>
On 06/06/2012 10:26, "Jan Beulich" <JBeulich@suse.com> wrote:
>>>> On 06.06.12 at 11:02, Keir Fraser <keir@xen.org> wrote:
>> On 06/06/2012 09:23, "Jan Beulich" <JBeulich@suse.com> wrote:
>>
>>> Other than in __list_splice(), the first element's prev pointer doesn't
>>> need adjustment here - it already is PAGE_LIST_NULL. Rather than fixing
>>> the assignment (to formally match __list_splice()), simply assert that
>>> this assignment is really unnecessary.
>>>
>>> Reported-by: Jisoo Yang <jisooy@gmail.com>
>>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>>>
>>> --- a/xen/include/xen/mm.h
>>> +++ b/xen/include/xen/mm.h
>>> @@ -270,7 +270,8 @@ page_list_splice(struct page_list_head *
>>> last = list->tail;
>>> at = head->next;
>>>
>>> - first->list.prev = page_to_pdx(head->next);
>>> + /* Both first->list.prev and at->list.prev are PAGE_LIST_NULL. */
>>
>> ASSERT(first->list.prev == PAGE_LIST_NULL); ?
>>
>> It seems odd to have one assumption encoded as an ASSERTion, and one as a
>> code comment... A second assertion makes the assumption explicit, and
>> run-time checked in debug builds.
>
> But the __list_splice() equivalent assignment would be
>
> first->list.prev = at->list.prev;
>
> which is why I chose the assert expression that way, yet made
> the comment clarify what the actual state is. If the comment
> just repeated what the ASSERT() already says, I'd rather drop
> the comment altogether.
I mean to replace the comment with a second assertion, not to replace the
assertion your patch already adds. Does that make sense?
-- Keir
> Jan
>
next prev parent reply other threads:[~2012-06-06 11:22 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-06 8:23 [PATCH] fix page_list_splice() Jan Beulich
2012-06-06 9:02 ` Keir Fraser
2012-06-06 9:26 ` Jan Beulich
2012-06-06 11:22 ` Keir Fraser [this message]
2012-06-07 19:10 ` Jan Beulich
2012-06-08 7:51 ` Keir Fraser
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=CBF4FBEF.3558E%keir.xen@gmail.com \
--to=keir.xen@gmail.com \
--cc=JBeulich@suse.com \
--cc=jisooy@gmail.com \
--cc=xen-devel@lists.xen.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.