Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Hillf Danton" <hdanton@sina.com>
To: "Ard Biesheuvel" <ard.biesheuvel@linaro.org>
Cc: Peter Zijlstra <peterz@infradead.org>,
	Hillf Danton <hdanton@sina.com>,
	Will Deacon <will.deacon@arm.com>,
	Dave Martin <Dave.Martin@arm.com>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>
Subject: [patch] arm64: assembler: Update the yield NEON comment
Date: Thu, 9 May 2019 15:01:43 +0000	[thread overview]
Message-ID: <177247.865216003-sendEmail@laptop-0p1i5f25> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 2312 bytes --]

The comment was a bit misleading when it was created in commit 24534b3511, and
deserves a tweak like,

- * - Check whether the preempt count is exactly 1, in which case disabling
- *   preemption once will make the task preemptible. If this is not the case,
+ * - Check whether the preempt count is exactly 1, in which case decrementing
+ *   preempt count once will make the task preemptible. If this is not the case,

then code fix was added in commit 7faa313f05 with the comment left behind untouched.

It no longer matches the code now, so fix it. It is changed along the original
direction as much as I can, though simply deleting the relevant block looks fine.

And finally a question remains: is it needed to decrement preempt count before
invoking kernel_neon_end() in which preempt_enable() is put at the end?

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Dave Martin <Dave.Martin@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Hillf Danton <hdanton@sina.com>
---
 arch/arm64/include/asm/assembler.h | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/arch/arm64/include/asm/assembler.h b/arch/arm64/include/asm/assembler.h
index c5308d0..8518a7b 100644
--- a/arch/arm64/include/asm/assembler.h
+++ b/arch/arm64/include/asm/assembler.h
@@ -713,13 +713,9 @@ USER(\label, ic	ivau, \tmp2)			// invalidate I line PoU
  * Note that the patchup code does not support assembler directives that change
  * the output section, any use of such directives is undefined.
  *
- * The yield itself consists of the following:
- * - Check whether the preempt count is exactly 1, in which case disabling
- *   preemption once will make the task preemptible. If this is not the case,
- *   yielding is pointless.
- * - Check whether TIF_NEED_RESCHED is set, and if so, disable and re-enable
- *   kernel mode NEON (which will trigger a reschedule), and branch to the
- *   yield fixup code.
+ * The yield itself decrements the preempt count and if count hits zero, disable
+ * and re-enable kernel mode NEON (which will trigger a reschedule), and branch
+ * to the yield fixup code.
  *
  * This macro sequence may clobber all CPU state that is not guaranteed by the
  * AAPCS to be preserved across an ordinary function call.
--


[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

             reply	other threads:[~2019-05-09 15:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-09 15:01 Hillf Danton [this message]
2019-05-10 13:26 ` [patch] arm64: assembler: Update the yield NEON comment Dave Martin
     [not found] <198595.152792649-sendEmail@laptop-0p1i5f25>
2019-05-13  8:56 ` Dave Martin
2019-05-13 16:38   ` Will Deacon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=177247.865216003-sendEmail@laptop-0p1i5f25 \
    --to=hdanton@sina.com \
    --cc=Dave.Martin@arm.com \
    --cc=ard.biesheuvel@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=peterz@infradead.org \
    --cc=will.deacon@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox