lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <4CBB6F9B.6080803@cyconix.com>
Date:	Sun, 17 Oct 2010 22:50:19 +0100
From:	Tom Brown <sa212+emis@...onix.com>
To:	LKML <linux-kernel@...r.kernel.org>
Subject: Canonical ring-buffer code : SMP, single-reader/writer

Does anyone happen to know of any good example code that I could use in 
a driver for a simple single-reader, single-writer, ring buffer, on an 
SMP system?

My own code doesn't use any locks, but I'm concerned that it may be 
flaky. It's running on an 8-core processor, and I'm worried that I may 
be seeing SMP locking issues which I don't understand because the driver 
is on one core, while the user is on another core.

In my case, the producer is the driver, and the consumer is the user. I 
could just lock all the driver writes to the buffer and the driver's 
update of the shared 'last written' pointer, but that seems a really 
poor design.

Thanks -

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ