From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932897AbcFBOCj (ORCPT ); Thu, 2 Jun 2016 10:02:39 -0400 Received: from mail-pa0-f68.google.com ([209.85.220.68]:36408 "EHLO mail-pa0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932814AbcFBOCh (ORCPT ); Thu, 2 Jun 2016 10:02:37 -0400 From: Ryusuke Konishi To: Andrew Morton Cc: linux-nilfs , LKML , Ryusuke Konishi Subject: [PATCH 7/8] nilfs2: do not use yield() Date: Thu, 2 Jun 2016 22:58:10 +0900 Message-Id: <1464875891-5443-8-git-send-email-konishi.ryusuke@lab.ntt.co.jp> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1464875891-5443-1-git-send-email-konishi.ryusuke@lab.ntt.co.jp> References: <1464875891-5443-1-git-send-email-konishi.ryusuke@lab.ntt.co.jp> X-Dispatcher: imput version 20110525(IM151) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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