When cfs_trace_get_tage_try()->cfs_tage_alloc() is allocating a debug
buffer, since
e2a2fab993d01597010cb2b44df44a522af0eec8 (b=21776) this
allocation is denied when the allocation is happening in a memory
freeing path. This caused a spurious "cannot allocate a tage" message
on the console each time. Quiet that message, since it is expected.
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Change-Id: Ic800c474dc33f62843b74e06d9ca642cad3ebbe5
Reviewed-on: http://review.whamcloud.com/5470
Tested-by: Hudson
Reviewed-by: Nathaniel Clark <nathaniel.l.clark@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
}
if (tcd->tcd_cur_pages < tcd->tcd_max_pages) {
}
if (tcd->tcd_cur_pages < tcd->tcd_max_pages) {
- if (tcd->tcd_cur_stock_pages > 0) {
- tage = cfs_tage_from_list(tcd->tcd_stock_pages.prev);
- -- tcd->tcd_cur_stock_pages;
- cfs_list_del_init(&tage->linkage);
- } else {
- tage = cfs_tage_alloc(CFS_ALLOC_ATOMIC);
- if (tage == NULL) {
- if (printk_ratelimit())
- printk(CFS_KERN_WARNING
- "cannot allocate a tage (%ld)\n",
- tcd->tcd_cur_pages);
- return NULL;
- }
- }
+ if (tcd->tcd_cur_stock_pages > 0) {
+ tage = cfs_tage_from_list(tcd->tcd_stock_pages.prev);
+ --tcd->tcd_cur_stock_pages;
+ cfs_list_del_init(&tage->linkage);
+ } else {
+ tage = cfs_tage_alloc(CFS_ALLOC_ATOMIC);
+ if (unlikely(tage == NULL)) {
+ if ((!cfs_memory_pressure_get() ||
+ cfs_in_interrupt()) && printk_ratelimit())
+ printk(CFS_KERN_WARNING
+ "cannot allocate a tage (%ld)\n",
+ tcd->tcd_cur_pages);
+ return NULL;
+ }
+ }
tage->used = 0;
tage->cpu = cfs_smp_processor_id();
tage->used = 0;
tage->cpu = cfs_smp_processor_id();