From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefano Stabellini Subject: Re: xen/p2m: m2p_find_override: use list_for_each_entry_safe Date: Fri, 20 Apr 2012 12:23:21 +0100 Message-ID: References: <20120420105112.GA21487@elgon.mountain> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="8323329-287627120-1334921017=:26786" Return-path: In-Reply-To: <20120420105112.GA21487@elgon.mountain> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Dan Carpenter Cc: "xen-devel@lists.xensource.com" , Konrad Rzeszutek Wilk , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org --8323329-287627120-1334921017=:26786 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT 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 --8323329-287627120-1334921017=:26786 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --8323329-287627120-1334921017=:26786--