Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp940979pxf; Wed, 7 Apr 2021 15:38:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxWpNcZMF4GkTGVXsBuL3M1rTYAjUJD4x6nxV9efivV6/oM4Pum0BjXTbQNMF7SWSO7stUP X-Received: by 2002:a63:1352:: with SMTP id 18mr5093207pgt.11.1617835103669; Wed, 07 Apr 2021 15:38:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617835103; cv=none; d=google.com; s=arc-20160816; b=CJDp6rXic+RmI7vQUU70Onn9Ka0JG+IEO9mZSFeUsDccXiqvoc76wTuYY//hHaAPhd MidqZ0IYv5eueNj4zw8m0eK/tNBUZpXvBl83Qgi1lh2DEu2tW5hiZasRIsnU9pTDY6Jl OICeMa+yl5+25+ci3myLT0A1xbvfwXdfKC8y7dTikBUkgkqR+eHrUpDS3Quq0kLOI3R1 RqHGmHrZ+tmcGwyz/xB0E78/pk7uhGNYZLHD1wyZo9yv+2Ea5F/wPaBKLrio+dw5rtc8 Z1lMfTF91XVQBgGF8/AM/jR4DgrocuYdmC8vZEG1a1d6vqoEd9n0R84daKuiG3pys/Gz 5eQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=x11JedQ758JkCFaOFtBqoObk8A4GggupZY+sy4Vsx4U=; b=FYUMP94A/GFiau0EjFhRP+GVsdcVlnJj6q5nvTSHs1arEpF16Q/gG4Ug5XnEl9HOO6 so/KCtoiwSVegi1XxYLPPW413rgS2WVRBSDuE9dm8iwRAeH7r/YwADMk412D4EuMTR9t /ejaDLAVj5hv4GPXbw1U7WZ3fkeACPsBp5j4adC9Pb2iwnpGSKJk1/1UOXbTgrRZeHvr tLOIlLpE2eRc0+37Fvh7GKg/q8BTd/YFNHS4cgvNeUPaKYai8VAqml3K6F1V4/4vWmdb Ver981vx5ZZyA8Y5fcHB9l2nljrjc2H+6yXK6f7E/vMLX7Puqfct4nSmH7fWtzemztvU cJZA== ARC-Authentication-Results: i=1; mx.google.com; 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 o1si13128163plg.160.2021.04.07.15.38.11; Wed, 07 Apr 2021 15:38:23 -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; 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 S1345237AbhDGOxE (ORCPT + 99 others); Wed, 7 Apr 2021 10:53:04 -0400 Received: from mail-pg1-f173.google.com ([209.85.215.173]:45638 "EHLO mail-pg1-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231416AbhDGOxC (ORCPT ); Wed, 7 Apr 2021 10:53:02 -0400 Received: by mail-pg1-f173.google.com with SMTP id d10so8398682pgf.12; Wed, 07 Apr 2021 07:52:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=x11JedQ758JkCFaOFtBqoObk8A4GggupZY+sy4Vsx4U=; b=We6nXCyf2ThfIHiPj+hVS4vBiZUxMaOh96gV0XeUcSuuOyMXQxHLx1enXPs+TmcBbA OkzQx9C2gYdlh2H2XSygfMvVIastHYEpgCJ0xWr/cg4ZoWd8q5+pFn3jWvjybbdcg9H+ H8YX4LLCgcC+R/FVi0ffhISyLc6YHt4hTg4uB12xhSM92pW5n/BALOA0UO55w9N/gD1X +2+9CFXGpU2pM+u4Yv5Pj88xpVZoqd7f3uYgphvcr0XeNNgrD87B07p4oACZX4VPoIIk Xms9HTgXNeoTuPC+kEABa8KKyzJefTjbeibMJITuAY/NbFecu8SXcCsIX3zH4/EoQJFV g93A== X-Gm-Message-State: AOAM533ZHqqbO64rHSMRiw+RIxKs2mC91r/t6t2JPMVVvssC33+nsg9S pphy0QzBKkg7HXQSPhdJgxU= X-Received: by 2002:a63:e5c:: with SMTP id 28mr3634340pgo.365.1617807172997; Wed, 07 Apr 2021 07:52:52 -0700 (PDT) Received: from 42.do-not-panic.com (42.do-not-panic.com. [157.230.128.187]) by smtp.gmail.com with ESMTPSA id f2sm20793876pfe.177.2021.04.07.07.52.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Apr 2021 07:52:52 -0700 (PDT) Received: by 42.do-not-panic.com (Postfix, from userid 1000) id 6804E402D7; Wed, 7 Apr 2021 14:52:51 +0000 (UTC) Date: Wed, 7 Apr 2021 14:52:51 +0000 From: Luis Chamberlain To: Minchan Kim Cc: keescook@chromium.org, dhowells@redhat.com, hch@infradead.org, mbenes@suse.com, gregkh@linuxfoundation.org, ngupta@vflare.org, sergey.senozhatsky.work@gmail.com, axboe@kernel.dk, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] zram: fix crashes due to use of cpu hotplug multistate Message-ID: <20210407145251.GD4332@42.do-not-panic.com> References: <20210322204156.GM4332@42.do-not-panic.com> <20210401235925.GR4332@42.do-not-panic.com> <20210405190023.GX4332@42.do-not-panic.com> <20210406002909.GY4332@42.do-not-panic.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 06, 2021 at 06:38:24PM -0700, Minchan Kim wrote: > To clarify what I understood form the discussion until now: > > 1. zram shouldn't allow creating more zram instance during > rmmod(It causes CPU multistate splat) Right! > 2. the private data of gendisk shouldn't destroyed while zram > sysfs knob is working(it makes system goes crash) Yup, this is resolved with the bdgrab / bdput on each sysfs knob. And the last issue is: 3) which patch 2/2 addresed. If a mutex is shared on sysfs knobs and module removal, you must do try_module_get() to prevent the deadlock. Luis