Re: [PATCH 3/4] relayfs for 2.6.10: locking/lockless implementation

From: Greg KH
Date: Wed Jan 19 2005 - 15:18:46 EST


On Fri, Jan 14, 2005 at 08:30:44PM -0500, Robert Wisniewski wrote:
> I believe the below illustrates the problem that will be seen without
> volatile.

Please read the lkml archives about all of the problems surrounding
marking variables "volatile" and how you really never want to do that in
the kernel. If you want to access a variable in two different places,
at the same time, just use a lock to keep it sane.

> > So these can just be removed, and the code changed to use the proper
> > atomic calls? If so, please do so.
>
> Yes we can remove the code and use the standard atomic calls, but based on
> the above example, I think we need to mark a couple variables volatile. Do
> you agree, if so, and unless there's dissenting opinion we can make the
> change.

No, I disagree. Just use the standard atomic calls, they will work just
fine.

thanks,

greg k-h
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/