Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756162AbcCaIpY (ORCPT ); Thu, 31 Mar 2016 04:45:24 -0400 Received: from mail-pf0-f182.google.com ([209.85.192.182]:35430 "EHLO mail-pf0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756013AbcCaIpR (ORCPT ); Thu, 31 Mar 2016 04:45:17 -0400 Date: Thu, 31 Mar 2016 17:46:39 +0900 From: Sergey Senozhatsky To: Yu Zhao Cc: Minchan Kim , Nitin Gupta , Sergey Senozhatsky , linux-mm@kvack.org, Dan Streetman , Seth Jennings , Sergey Senozhatsky , Andrew Morton , linux-kernel@vger.kernel.org Subject: Re: [PATCH] zsmalloc: use workqueue to destroy pool in zpool callback Message-ID: <20160331084639.GB3343@swordfish> References: <1459288977-25562-1-git-send-email-yuzhao@google.com> <20160329235950.GA19927@bbox> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160329235950.GA19927@bbox> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1286 Lines: 36 On (03/30/16 08:59), Minchan Kim wrote: > On Tue, Mar 29, 2016 at 03:02:57PM -0700, Yu Zhao wrote: > > zs_destroy_pool() might sleep so it shouldn't be used in zpool > > destroy callback which can be invoked in softirq context when > > zsmalloc is configured to work with zswap. > > I think it's a limitation of zswap design, not zsmalloc. > Could you handle it in zswap? agree. hm, looking at this backtrace > [] mutex_lock+0x1b/0x2f > [] kmem_cache_destroy+0x50/0x130 > [] zs_destroy_pool+0x85/0xe0 > [] zs_zpool_destroy+0xe/0x10 > [] zpool_destroy_pool+0x54/0x70 > [] __zswap_pool_release+0x62/0x90 > [] rcu_process_callbacks+0x22e/0x640 > [] ? run_timer_softirq+0x3e/0x280 > [] __do_softirq+0xcb/0x250 > [] irq_exit+0x9c/0xb0 > [] smp_apic_timer_interrupt+0x6a/0x80 > [] apic_timer_interrupt+0x7f/0x90 it also can hit the following path rcu_process_callbacks() __zswap_pool_release() zswap_pool_destroy() zswap_cpu_comp_destroy() cpu_notifier_register_begin() mutex_lock(&cpu_add_remove_lock); <<< can't it? -ss