Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp836380pxb; Thu, 21 Oct 2021 10:21:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyFvG0VDThIjrJZf92mDwJC9vYX4SCSef35Lx7b5VD3IKcsRkUziWkMeMgX5hEobNEfDmxU X-Received: by 2002:a17:906:f2d0:: with SMTP id gz16mr8842150ejb.102.1634836907144; Thu, 21 Oct 2021 10:21:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634836907; cv=none; d=google.com; s=arc-20160816; b=FgtSGrouNpHFKyoQnf/Zf3JqKIwE3F0Y0iUGnedt7UWDEobf3izdiJF1rlNXIKOID8 908W+X9zL5pQVfARSvbKGfDGdz5m9Iw1VbZnk5bns/tuQIYdCFdU0Wbw+c9MRt0uQXHk Bkp9rZSzhFaq7afGbyC046lwnOXS6S1puevxeOUfqLFc0jOhkRbqK0bmut9ZBB3540iC y4/lSenRU4kPUuwRh9s6AEDBUw4JP7b3+or/MGb/BF7pwutFXXjkopPSQ4pNdJcfRZtM zcwVSafUMVTXINyhO3NWgUs8/0XVwUf28ju6R0O34GBsBOYn6tHgPnk3jX0NrU9Vv3Iu s2PQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=AD7baqDv7qcOXIpKfV7ERWwjC0Jt5iI28VcJ9GrCqks=; b=uYMioGnbAgt2Zf04l7TmGRc9ZyAwmtGbJMoePCVF6Jd1OUaf98XMutl1dctAekqCxh 2zEP2wHdXYVpU55BjCedmoUP6oJKrB1Zh2s0NQ19u9rCcVejhVgbOQSTEpMxqzN4ZJo9 fAiSc/n1L30mT2GmewRB5xhPWGvcrrNCxUhq+VG4yHtfjszX0jnzusmrPQtv1PF8EUjR b1pZ1zcN0pgObLl2a7myd1r4aR51FpVDRsYd5KeQqM29Qvr5rgvpQ/FCVjMOV7axhq80 eFdg61JAySrqqMPOITRRncLEseZlzu2S+D4MuOp0kJYc9i9zCOB8x12iqLm/gxaC7RPC /ztw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b="rZTla/b7"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e10si10222141edj.222.2021.10.21.10.21.22; Thu, 21 Oct 2021 10:21:47 -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=@infradead.org header.s=bombadil.20210309 header.b="rZTla/b7"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232055AbhJURVV (ORCPT + 99 others); Thu, 21 Oct 2021 13:21:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51704 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229567AbhJURVR (ORCPT ); Thu, 21 Oct 2021 13:21:17 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C0977C061764; Thu, 21 Oct 2021 10:19:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=AD7baqDv7qcOXIpKfV7ERWwjC0Jt5iI28VcJ9GrCqks=; b=rZTla/b7wEl07NyABgcNxY4UWI 6JYo0XaNvaYZ3UxR5KpgG/qNARinza7TjgaNGaBeO6CX8cPtGObHKiCHqQzQRzg3r0K5hun+hUiQB JBYk+83/2/jiTN5s0tLuOeMdhxRuCu/eFq5Uh74WlzeOFtcncBfRQlntYmi6Hjge9bFsOrBo5NfSo XWcjBM8locwogPOgmFNCI/tOpS93yC7LWUUkPEccW+0rf2d92TnZ83zCop52oeZpWZYchrbZY+1ue pIG/OXVZDujhVNGknKs5lBF2owxKIDNKvMZQ57PWscfx06l4OwXv8Hu0JGDOEJzOZsyB2ktlNSET7 oVfNOJ5g==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1mdbiJ-008UQT-NH; Thu, 21 Oct 2021 17:18:47 +0000 Date: Thu, 21 Oct 2021 10:18:47 -0700 From: Luis Chamberlain To: Ming Lei Cc: 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 Subject: Re: [PATCH v8 11/12] zram: fix crashes with cpu hotplug multistate Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: Luis Chamberlain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 21, 2021 at 08:39:05AM +0800, Ming Lei wrote: > On Wed, Oct 20, 2021 at 08:48:04AM -0700, Luis Chamberlain wrote: > > A second series of tests is hitting CTRL-C on either randonly and > > restarting testing once again randomly. > > ltp/zram02.sh has cleanup handler via trap to clean everything(swapoff/umount/reset/ > rmmod), ctrl-c will terminate current forground task and cause shell to run the > cleanup handler first, but further 'ctrl-c' will terminate the cleanup handler, > then the cleanup won't be done completely, such as zram disk is left as swap > device and zram can't be unloaded. The idea can be observed via the following > script: > > #!/bin/bash > trap 'echo "enter trap"; sleep 20; echo "exit trap";' INT > sleep 30 > > After the above script is run foreground, when 1st ctrl-c is pressed, 'sleep 30' > is terminated, then the trap command is run, so you can see "enter trap" > dumped. Then if you pressed 2nd ctrl-c, 'sleep 20' is terminated immediately. > So 'swapoff' from zram02.sh's trap function can be terminated in this way. > > zram disk being left as swap disk can be observed with your patch too > after terminating via multiple ctrl-c which has to be done this way because > the test is dead loop. > > So it is hard to cleanup everything completely after multiple 'CTRL-C' is > involved, and it should be impossible. It needs violent multiple ctrl-c to > terminate the dealoop test. > > So it isn't reasonable to expect that zram can be always unloaded successfully > after the test script is terminated via multiple ctrl-c. For the life of me, I do not run into these issue with my patch. But with yours I had. To be clear, I run zram02.sh on two terminals. Then to interrupt I just leave CTRL-C pressed to issue multiple terminations until the script is done on each terminal at a time, until I see both have completed. I repeat the same test, noting always that when I start one one terminal the test is succeeding. And also when I cancel completely one script the test continue fine without issue. > But zram can be unloaded after running swapoff manually, from driver > viewpoint, nothing is wrong. I had not run into that issue with my patch FWIW. Luis