Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752317Ab3FNHbI (ORCPT ); Fri, 14 Jun 2013 03:31:08 -0400 Received: from e28smtp06.in.ibm.com ([122.248.162.6]:49998 "EHLO e28smtp06.in.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752269Ab3FNHbG (ORCPT ); Fri, 14 Jun 2013 03:31:06 -0400 From: Wanpeng Li To: Andrew Morton Cc: Michal Hocko , David Rientjes , "Kirill A. Shutemov" , Fengguang Wu , Rik van Riel , Andrew Shewmaker , Jiri Kosina , Namjae Jeon , Jan Kara , Tejun Heo , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Wanpeng Li Subject: [PATCH 3/8] mm/writeback: Don't check force_wait to handle bdi->work_list Date: Fri, 14 Jun 2013 15:30:36 +0800 Message-Id: <1371195041-26654-3-git-send-email-liwanp@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1371195041-26654-1-git-send-email-liwanp@linux.vnet.ibm.com> References: <1371195041-26654-1-git-send-email-liwanp@linux.vnet.ibm.com> X-TM-AS-MML: No X-Content-Scanned: Fidelis XPS MAILER x-cbid: 13061407-9574-0000-0000-0000084A6BD2 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2080 Lines: 55 After commit 839a8e86("writeback: replace custom worker pool implementation with unbound workqueue"), bdi_writeback_workfn runs off bdi_writeback->dwork, on each execution, it processes bdi->work_list and reschedules if there are more things to do instead of flush any work that race with us existing. It is unecessary to check force_wait in wb_do_writeback since it is always 0 after the mentioned commit. This patch remove the force_wait in wb_do_writeback. Signed-off-by: Wanpeng Li --- fs/fs-writeback.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c index f892dec..e15aa97 100644 --- a/fs/fs-writeback.c +++ b/fs/fs-writeback.c @@ -959,7 +959,7 @@ static long wb_check_old_data_flush(struct bdi_writeback *wb) /* * Retrieve work items and do the writeback they describe */ -static long wb_do_writeback(struct bdi_writeback *wb, int force_wait) +static long wb_do_writeback(struct bdi_writeback *wb) { struct backing_dev_info *bdi = wb->bdi; struct wb_writeback_work *work; @@ -967,12 +967,6 @@ static long wb_do_writeback(struct bdi_writeback *wb, int force_wait) set_bit(BDI_writeback_running, &wb->bdi->state); while ((work = get_next_work_item(bdi)) != NULL) { - /* - * Override sync mode, in case we must wait for completion - * because this thread is exiting now. - */ - if (force_wait) - work->sync_mode = WB_SYNC_ALL; trace_writeback_exec(bdi, work); @@ -1021,7 +1015,7 @@ void bdi_writeback_workfn(struct work_struct *work) * rescuer as work_list needs to be drained. */ do { - pages_written = wb_do_writeback(wb, 0); + pages_written = wb_do_writeback(wb); trace_writeback_pages_written(pages_written); } while (!list_empty(&bdi->work_list)); } else { -- 1.8.1.2 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/