Whamcloud - gitweb
LU-2576 osc: various fix in osc_enter_cache()
authorNiu Yawei <niu@whamcloud.com>
Sun, 6 Jan 2013 08:21:03 +0000 (03:21 -0500)
committerOleg Drokin <green@whamcloud.com>
Thu, 31 Jan 2013 03:19:01 +0000 (22:19 -0500)
commitd1eb3357bab215018bcb29877ed8b2990e65cc73
tree8613b6bf4c8be956e748a30d5ed77d27d2c2cf0a
parent622148ee4bf305bc32ecf565d42c97f466cc90d8
LU-2576 osc: various fix in osc_enter_cache()

- It should not go to sleep if there isn't any inflight write
  RPC, otherwise, it could not be waked up for a long time,
  until dirty flush triggered on other OSCs or other objects.

- If the page can't be granted due to too many dirty pages
  (> obd_max_dirty_pages), osc_enter_cache() should return
  -EDQUOT.

- It should pass NULL osc object to  osc_io_unplug(), otherwise
  dirty flush can't be triggered if the passed object is
  clean.

- It should not wait in a loop of "while (cli->cl_dirty > 0)",
  trigger the dirty flush once is enough. If there are too
  many threads that consumed grants immediately, then we
  should turn to sync write, but not trigger flush and wait
  for grant again (that'll block io process on grant).

- Refuse setting max_dirty_mb as 0 via proc file.

Signed-off-by: Niu Yawei <yawei.niu@intel.com>
Change-Id: I449cba07bd427749ab023c249d9e200aba1b406a
Reviewed-on: http://review.whamcloud.com/4963
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Prakash Surya <surya1@llnl.gov>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/osc/lproc_osc.c
lustre/osc/osc_cache.c