From 66be2e6014a7bf20b2f749c877cb141b209f15d9 Mon Sep 17 00:00:00 2001 From: Jinshan Xiong Date: Tue, 26 Feb 2013 09:31:54 +0800 Subject: [PATCH] LU-2859 osc: unplug IO queue async to avoid stack overflow Otherwise, there is a stack overflow problem with the following stacktrace: 18 cfs_trace_unlock_tcd at ffffffffa034336c [libcfs] 19 libcfs_debug_vmsg2 at ffffffffa0354038 [libcfs] 20 libcfs_debug_msg at ffffffffa03545f1 [libcfs] 21 osc_key_init at ffffffffa0a90e17 [osc] 22 keys_fill at ffffffffa06d8c3f [obdclass] 23 lu_context_init at ffffffffa06dcc6b [obdclass] 24 lu_env_init at ffffffffa06dce3e [obdclass] 25 cl_env_new at ffffffffa06e40bd [obdclass] 26 cl_env_get at ffffffffa06e4acb [obdclass] 27 lov_sub_get at ffffffffa0b3777d [lov] 28 lov_page_subio at ffffffffa0b37c5d [lov] 29 lov_page_own at ffffffffa0b311af [lov] 30 cl_page_own0 at ffffffffa06e8b5b [obdclass] 31 cl_page_own_try at ffffffffa06e8db3 [obdclass] 32 discard_pagevec at ffffffffa0a926a9 [osc] 33 osc_lru_shrink at ffffffffa0a935d9 [osc] 34 osc_lru_del at ffffffffa0a94aa6 [osc] 35 osc_page_delete at ffffffffa0a951b4 [osc] 36 cl_page_delete0 at ffffffffa06e99e5 [obdclass] 37 cl_page_delete at ffffffffa06e9e62 [obdclass] 38 ll_releasepage at ffffffffa0bfe41b [lustre] 39 try_to_release_page at ffffffff81110070 40 shrink_page_list.clone.0 at ffffffff8112a501 41 shrink_inactive_list at ffffffff8112a8cb 42 shrink_zone at ffffffff8112b5df 43 zone_reclaim at ffffffff8112c384 44 get_page_from_freelist at ffffffff81122834 45 __alloc_pages_nodemask at ffffffff81123ab1 46 kmem_getpages at ffffffff8115e2f2 47 cache_grow at ffffffff8115e95f 48 cache_alloc_refill at ffffffff8115ebb2 49 __kmalloc at ffffffff8115f8d9 50 cfs_alloc at ffffffffa0344c40 [libcfs] 51 ptlrpc_request_alloc_internal at ffffffffa085d407 [ptlrpc] 52 ptlrpc_request_alloc_pool at ffffffffa085d66e [ptlrpc] 53 osc_brw_prep_request at ffffffffa0a8451b [osc] 54 osc_build_rpc at ffffffffa0a8a513 [osc] 55 osc_io_unplug0 at ffffffffa0aa642d [osc] 56 osc_io_unplug at ffffffffa0aa7ce1 [osc] 57 osc_enter_cache at ffffffffa0aa8473 [osc] 58 osc_queue_async_io at ffffffffa0aae916 [osc] 59 osc_page_cache_add at ffffffffa0a94fc9 [osc] 60 cl_page_cache_add at ffffffffa06e61d7 [obdclass] 61 lov_page_cache_add at ffffffffa0b31325 [lov] 62 cl_page_cache_add at ffffffffa06e61d7 [obdclass] 63 vvp_io_commit_write at ffffffffa0c1161d [lustre] 64 cl_io_commit_write at ffffffffa06f5b1d [obdclass] 65 ll_commit_write at ffffffffa0be68be [lustre] 66 ll_write_end at ffffffffa0bfe4e0 [lustre] 67 generic_file_buffered_write at ffffffff81111684 68 __generic_file_aio_write at ffffffff81112f70 69 generic_file_aio_write at ffffffff8111320f 70 vvp_io_write_start at ffffffffa0c11f3c [lustre] 71 cl_io_start at ffffffffa06f244a [obdclass] 72 cl_io_loop at ffffffffa06f6d54 [obdclass] 73 ll_file_io_generic at ffffffffa0bbda7b [lustre] 74 ll_file_aio_write at ffffffffa0bbdce2 [lustre] 75 ll_file_write at ffffffffa0bbeaac [lustre] 76 vfs_write at ffffffff81177b98 77 sys_write at ffffffff811785a1 Signed-off-by: Jinshan Xiong Change-Id: Id61b481fe2036a4d7adb7140c39e50fe61c264ba Reviewed-on: http://review.whamcloud.com/5526 Tested-by: Hudson Reviewed-by: Lai Siyao Reviewed-by: Prakash Surya Tested-by: Maloo Reviewed-by: Oleg Drokin --- lustre/osc/osc_cache.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/lustre/osc/osc_cache.c b/lustre/osc/osc_cache.c index 37b249f..581beb6 100644 --- a/lustre/osc/osc_cache.c +++ b/lustre/osc/osc_cache.c @@ -1533,12 +1533,7 @@ static int osc_enter_cache(const struct lu_env *env, struct client_obd *cli, ocw.ocw_rc = 0; client_obd_list_unlock(&cli->cl_loi_list_lock); - /* First osc_io_unplug() tries to put current object - * on ready list, second osc_io_unplug() makes sure that - * dirty flush can still be triggered even if current - * object hasn't any dirty pages */ - osc_io_unplug(env, cli, osc, PDL_POLICY_ROUND); - osc_io_unplug(env, cli, NULL, PDL_POLICY_ROUND); + osc_io_unplug_async(env, cli, NULL); CDEBUG(D_CACHE, "%s: sleeping for cache space @ %p for %p\n", cli->cl_import->imp_obd->obd_name, &ocw, oap); -- 1.8.3.1