Skip to contentSkip to conversation

naïve question

DISCUSSION Massimiliano Hofer 1 participant 1 message Apr 20, 2006 netfilter

lore
Share & tools
lore
#0 lore raw

Hi,
I noticed in various part of the kernel that there are assignments on live kernel structures without locks to protect them (of course there are proper memory barriers).

Example from ipt_recent.c:

	curr_table->status_proc->read_proc = ip_recent_get_info;
	curr_table->status_proc->write_proc = ip_recent_ctrl;

I know that on a x86 a 32 bit assignment is atomic (I'm not sure about 386SXs) and the same goes for x86_64 and 64 bit pointer, but I'm not sure that it really works on other architectures.

I didn't find documentation about it. Is it just a normal practice due to the fact that exotic archs with odd bus widths aren't usually SMP or is it guaranteed?

Signature · 3 lines
Saluti,
   Massimiliano Hofer
        Nucleus