From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935992AbcJQQ5w (ORCPT ); Mon, 17 Oct 2016 12:57:52 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:44172 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757874AbcJQQ4T (ORCPT ); Mon, 17 Oct 2016 12:56:19 -0400 From: Mauro Carvalho Chehab To: Linux Doc Mailing List Cc: Mauro Carvalho Chehab , Mauro Carvalho Chehab , LKML , Jonathan Corbet , Mauro Carvalho Chehab , Greg Kroah-Hartman Subject: [PATCH 31/32] Documentation/volatile-considered-harmful.txt: convert to ReST markup Date: Mon, 17 Oct 2016 14:56:08 -0200 Message-Id: <11e23a5ff9b2d7bb7e3c67a09677566940ad6694.1476717925.git.mchehab@s-opensource.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org - Fix document section markups; - use quote blocks where needed; - adjust spaces and blank lines; - add it to the development-processs book. Signed-off-by: Mauro Carvalho Chehab --- Documentation/development-process/index.rst | 1 + .../volatile-considered-harmful.rst | 1 + Documentation/volatile-considered-harmful.txt | 19 +++++++++++-------- 3 files changed, 13 insertions(+), 8 deletions(-) create mode 120000 Documentation/development-process/volatile-considered-harmful.rst diff --git a/Documentation/development-process/index.rst b/Documentation/development-process/index.rst index 6c67a6e7534f..ec0e0c25af30 100644 --- a/Documentation/development-process/index.rst +++ b/Documentation/development-process/index.rst @@ -27,5 +27,6 @@ Contents: CodeOfConflict adding-syscalls magic-number + volatile-considered-harmful development-process diff --git a/Documentation/development-process/volatile-considered-harmful.rst b/Documentation/development-process/volatile-considered-harmful.rst new file mode 120000 index 000000000000..9a1f139a8441 --- /dev/null +++ b/Documentation/development-process/volatile-considered-harmful.rst @@ -0,0 +1 @@ +../volatile-considered-harmful.txt \ No newline at end of file diff --git a/Documentation/volatile-considered-harmful.txt b/Documentation/volatile-considered-harmful.txt index db0cb228d64a..e0d042af386c 100644 --- a/Documentation/volatile-considered-harmful.txt +++ b/Documentation/volatile-considered-harmful.txt @@ -22,7 +22,7 @@ need to use volatile as well. If volatile is still necessary, there is almost certainly a bug in the code somewhere. In properly-written kernel code, volatile can only serve to slow things down. -Consider a typical block of kernel code: +Consider a typical block of kernel code:: spin_lock(&the_lock); do_something_on(&shared_data); @@ -57,7 +57,7 @@ optimization, so, once again, volatile is unnecessary. Another situation where one might be tempted to use volatile is when the processor is busy-waiting on the value of a variable. The right -way to perform a busy wait is: +way to perform a busy wait is:: while (my_variable != what_i_want) cpu_relax(); @@ -103,17 +103,20 @@ they come with a justification which shows that the concurrency issues have been properly thought through. -NOTES ------ +References +========== [1] http://lwn.net/Articles/233481/ + [2] http://lwn.net/Articles/233482/ -CREDITS -------- +Credits +======= Original impetus and research by Randy Dunlap + Written by Jonathan Corbet + Improvements via comments from Satyam Sharma, Johannes Stezenbach, Jesper - Juhl, Heikki Orsila, H. Peter Anvin, Philipp Hahn, and Stefan - Richter. +Juhl, Heikki Orsila, H. Peter Anvin, Philipp Hahn, and Stefan +Richter. -- 2.7.4