Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp884368pxb; Wed, 27 Oct 2021 14:26:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy+rYbnF7F2lh2dQcDz67yJkdxAL+S6MxuIIkBNaBuSiHFvVdbgO/OtkU0B6+LuU4Orlw+h X-Received: by 2002:a17:907:2cc6:: with SMTP id hg6mr65636ejc.21.1635369888251; Wed, 27 Oct 2021 14:24:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635369888; cv=none; d=google.com; s=arc-20160816; b=uviq4D3Ii0oDzuQDzOmfkBXF5vj7nfSJOx8O353FZw+XVas+rvfsmein7lDjF1ARae gWvOw7+nojWnUHBoWfoSxtQpZHpU9OwSmnTfPj6iZ0Bq9hYfLcJWCw25yJYKJ6d6JlKQ btpYeyM8B5NMwxJaE7TyFAFJxpMmIJzPuGoFnp2OXi4zX2+Ee4zFCl9Najys/o6w23Jt 17oLGhvfOK24vxennofg+BvITHMcfHbVKh3PCKNPKJhPTcZ2ik1kslU8oFuWKvdPvT9k f6tXSBthaqSzVf8A07SSAgwKWjYqWWWZs4dJmsVZd+qEOzfEsmcGAD5IsMObnEVASKLd ZBQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:message-id :in-reply-to:subject:cc:to:from:date:dkim-signature:dkim-signature; bh=fo5sUfTsUY3UOkgJ2rkzuihsx0B4xmZU0SJdKHg3/K8=; b=mmcaZHR98pkeVUeZvK0zEqGwILDkJsLEE6fD4g+hsIuiTp5o3b1PVaolo6Cvby8Jnp NPf6zdkLANGvLIpfTicSWADWkIiylUyiN40ZPwGR43JVJIV8fjETvHAfxjNwmi4WQUys D1EyGSOORc6Kf7e1qzlA5UbpzAD1DgRD/oPbtDvtjHfY/djobVpoIeJkdc9MhXNiKCPf bnzTWgwvBnVxqjL7qwF1SzN+/7/qKi5hb9yjVcp0WWFKLZRL9B6h9wUDjS+/POncO3kN d1GzzKi1GKwoJVXG/5cJf6Lj3tTLDs4CQ6t/kK6n35ldz1YIWYiKAIKc0kQ0jZm6hajR fLCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=BOue54Gc; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=+LylReF1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qk38si1692805ejc.373.2021.10.27.14.24.25; Wed, 27 Oct 2021 14:24:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=BOue54Gc; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=+LylReF1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241703AbhJ0LpH (ORCPT + 97 others); Wed, 27 Oct 2021 07:45:07 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:44210 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239798AbhJ0LpG (ORCPT ); Wed, 27 Oct 2021 07:45:06 -0400 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 633E01FD3C; Wed, 27 Oct 2021 11:42:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1635334959; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=fo5sUfTsUY3UOkgJ2rkzuihsx0B4xmZU0SJdKHg3/K8=; b=BOue54GcW/uw1WPm5hiAmIdhozSdpxtIujuKNq+5lCqra257QQ5+yVC0mYQ5eawxHlKDyr nU0ifZU6580JYGww6p7MTa4j1eGWh/EpWynHxEW0BXP7jLQv8eUL4O/7yjEmIobBV3v+V+ clwH2P5+gllvmD14GruEDwwE2lrVid8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1635334959; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=fo5sUfTsUY3UOkgJ2rkzuihsx0B4xmZU0SJdKHg3/K8=; b=+LylReF1y8AGvSIYf9Izx8bkit9K4VmPNvnYXAU1IXcpJZ3PzIoU+CbwuMhJJKdrER1wb3 YbEesObRpQJsk5Bg== Received: from pobox.suse.cz (pobox.suse.cz [10.100.2.14]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id B48FCA3B84; Wed, 27 Oct 2021 11:42:38 +0000 (UTC) Date: Wed, 27 Oct 2021 13:42:38 +0200 (CEST) From: Miroslav Benes To: Ming Lei cc: Petr Mladek , Luis Chamberlain , Benjamin Herrenschmidt , Paul Mackerras , tj@kernel.org, gregkh@linuxfoundation.org, akpm@linux-foundation.org, minchan@kernel.org, jeyu@kernel.org, shuah@kernel.org, bvanassche@acm.org, dan.j.williams@intel.com, joe@perches.com, tglx@linutronix.de, keescook@chromium.org, rostedt@goodmis.org, linux-spdx@vger.kernel.org, linux-doc@vger.kernel.org, linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, live-patching@vger.kernel.org Subject: Re: [PATCH v8 11/12] zram: fix crashes with cpu hotplug multistate In-Reply-To: Message-ID: References: User-Agent: Alpine 2.21 (LSU 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > > > The livepatch code uses workqueue because the livepatch can be > > disabled via sysfs interface. It obviously could not wait until > > the sysfs interface is removed in the sysfs write() callback > > that triggered the removal. > > If klp_free_patch_* is moved into module_exit() and not let enable > store() to kill kobjects, all kobjects can be deleted in module_exit(), > then wait_for_completion(patch->finish) may be removed, also wq isn't > required for the async cleanup. It sounds like a nice cleanup. If we combine kobject_del() to prevent any show()/store() accesses and free everything later in module_exit(), it could work. If I am not missing something around how we maintain internal lists of live patches and their modules. Thanks Miroslav