All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: xen/p2m: m2p_find_override: use list_for_each_entry_safe
Date: Fri, 20 Apr 2012 12:23:21 +0100	[thread overview]
Message-ID: <alpine.DEB.2.00.1204201213100.26786@kaball-desktop> (raw)
In-Reply-To: <20120420105112.GA21487@elgon.mountain>

[-- Attachment #1: Type: text/plain, Size: 1033 bytes --]

On Fri, 20 Apr 2012, Dan Carpenter wrote:
> Hi Stefano,
> 
> I had a question about 8f2854c74ff4: "xen/p2m: m2p_find_override: use
> list_for_each_entry_safe".
> 
> I think there is a misunderstanding about what the
> list_for_each_entry_safe() macro does.  It has nothing to do with
> locking, so the spinlock is still needed.  Without the lock ->next could
> point to an element which has been deleted in another thread.  Probably
> the patch should be reverted.

I thought that list_for_each_entry_safe is safe against deletion, is it
not?
It doesn't matter whether we get up to date entries or old entries
here as long as walking through the list doesn't break if a concurrent
thread adds or removes items.


> Also, it introduces a GCC warning:
> arch/x86/xen/p2m.c:811:16: warning: unused variable ‘flags’
> 	[-Wunused-variable]

I think that Konrad didn't submit the latest version of the patch (v3),
that has a better description and also removes the flags variable:
http://marc.info/?l=linux-kernel&m=133407526406072&w=2

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

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

  reply	other threads:[~2012-04-20 11:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-20 10:51 xen/p2m: m2p_find_override: use list_for_each_entry_safe Dan Carpenter
2012-04-20 11:23 ` Stefano Stabellini [this message]
2012-04-20 11:35   ` Dan Carpenter
2012-04-20 13:36     ` Stefano Stabellini
2012-04-20 16:01       ` Konrad Rzeszutek Wilk

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=alpine.DEB.2.00.1204201213100.26786@kaball-desktop \
    --to=stefano.stabellini@eu.citrix.com \
    --cc=dan.carpenter@oracle.com \
    --cc=konrad.wilk@oracle.com \
    --cc=xen-devel@lists.xensource.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 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.