Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1412254

[PATCH 7/8] nilfs2: do not use yield()

From Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Newsgroups linux.kernel
Subject [PATCH 7/8] nilfs2: do not use yield()
Date 2016-06-02 16:10 +0200
Message-ID <rFBtU-6Tw-21@gated-at.bofh.it> (permalink)
References <rFBtU-6Tw-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Use cond_resched() instead of yield() in the loop of
nilfs_transaction_lock() since the usage corresponds to the "be nice
for others" case that the comment of yield() says.

This removes the following checkpatch.pl warning:

 "WARNING: Using yield() is generally wrong. See yield() kernel-doc
  (sched/core.c)"

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
---
 fs/nilfs2/segment.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/nilfs2/segment.c b/fs/nilfs2/segment.c
index 7e1864c..5a97282 100644
--- a/fs/nilfs2/segment.c
+++ b/fs/nilfs2/segment.c
@@ -373,7 +373,7 @@ static void nilfs_transaction_lock(struct super_block *sb,
 		nilfs_segctor_do_immediate_flush(sci);
 
 		up_write(&nilfs->ns_segctor_sem);
-		yield();
+		cond_resched();
 	}
 	if (gcflag)
 		ti->ti_flags |= NILFS_TI_GC;
-- 
1.8.3.1

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/8] nilfs2 updates Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> - 2016-06-02 16:10 +0200
  [PATCH 7/8] nilfs2: do not use yield() Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> - 2016-06-02 16:10 +0200
  [PATCH 3/8] nilfs2: embed a back pointer to super block instance in nilfs object Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> - 2016-06-02 16:10 +0200
  [PATCH 8/8] nilfs2: refactor parser of snapshot mount option Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> - 2016-06-02 16:10 +0200
  [PATCH 2/8] nilfs2: add nilfs_msg() message interface Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> - 2016-06-02 16:10 +0200
  [PATCH 5/8] nilfs2: replace nilfs_warning() with nilfs_msg() Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> - 2016-06-02 16:10 +0200
  [PATCH 6/8] nilfs2: emit error message when I/O error is detected Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> - 2016-06-02 16:10 +0200

csiph-web