Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp619739pxf; Wed, 10 Mar 2021 13:23:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJwDWdqr06gONyvA8Uk/zk9Fe9tEVGub1bN5F0dr8Zt96DCTUN57psaQdzK3em1piyU/z8Ia X-Received: by 2002:a17:906:fa0e:: with SMTP id lo14mr369053ejb.263.1615411427314; Wed, 10 Mar 2021 13:23:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615411427; cv=none; d=google.com; s=arc-20160816; b=loqqFV/pRInxsZX2yUMKXuQEki9jfcLteIxeRH9ICq0io6geKM1JVRrE8zLB3ZS0CM OKZF1flsBWNwOnELA05s7tiw8QnmyuAOa6b50eLrPe+eBm+/XXiyKrHtzV+FNH4WYzJ2 iZfM5KFVbHdRsY8eW5wK6ln2LvOvpuS7fswaE9mjxlYreWFndcLOFwlkusYhToaQZOtU CCp/S0XfeHYFjdU3Q3H9R/Nz5KDSPcA73xuTKig2RD5bClAVx3fJrGjJq1fifEK8m/T3 l3EdBc77t5i1czQ2VsuuVW+mNqSQjqcYrrwpnomSUfsOY51pgjMdavVkNsL+IsDzFzgu 9aXA== 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=Nx7DyCkQIr9THs33CM8Ho+zFue/EmVe3T9nz06hnrv4=; b=e5rgxH9v4v9DeRascTyLj/fD/ooPd2x5ufa1HWuGnTEnFh3lY3QR3MCFOkSSxjuLlE JOi12cmUVrptHRVwW7IoScUTbmkpVRIFOjSwQHj1GjG1oiliAaE6xkR6m8UhfSaR+upF V/5qiHVA4YiDsA7r84urk+hfompCueFdmoGiq3aadPqNtKIzhV6V8nw0/noxtvY7mUPH V5KrenUEDqEypIsL0PpVSA8GtSE+LgcqMQVRfvNYskMkZlJJEonGpmJQE97Jz1s4oaTK KfcKUlpWeSTImse8mY3SX79F9Po6QXAzi4jhXnCYZRoqms8ozQGDffo5MfA1exmtB3Wk GzcQ== 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 w24si306339ejb.608.2021.03.10.13.23.12; Wed, 10 Mar 2021 13:23:47 -0800 (PST) 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 S231776AbhCJVVq (ORCPT + 99 others); Wed, 10 Mar 2021 16:21:46 -0500 Received: from mail-pl1-f178.google.com ([209.85.214.178]:38938 "EHLO mail-pl1-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229563AbhCJVVa (ORCPT ); Wed, 10 Mar 2021 16:21:30 -0500 Received: by mail-pl1-f178.google.com with SMTP id j6so9128062plx.6; Wed, 10 Mar 2021 13:21:30 -0800 (PST) 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=Nx7DyCkQIr9THs33CM8Ho+zFue/EmVe3T9nz06hnrv4=; b=dA2brjRzSOzUfqKGkJ3J4Q7y2jHabfCiJSMWaY8L08g2IgRYBov6Qg5gpB6cCtcm4o zJyAWGFjR9FCI0jwv9QHGg+O9CH7C5TUpGjAJ1rQ/WcEAsQK6CLIFEd/XgUGHlQRTRmH acMlKyMCxML3uWZxI2BWE+PgF5NZxPeLVZV1BZnHJis6AeFhsBK1DHoD8sDvI5VqC9rD PXb6Cws7uCWS2oh08bFhGxmUdcZyaWDfk3WOfIZ1dVp/b/+CxREphKo9YFgNRth45Axx VlSGl8F15MB95zTQItOeV8g7sbx9omVrPQ7MELrslOnoB7KYa0/POQXVcgnizVzEk/US CvEA== X-Gm-Message-State: AOAM533OYqnK4Jk03dlPCn/bWx8W20BC3ZHc7VbL6DfwsVr3NKG9C6mZ J+A8cX95rTIfdJHZgIGLDLw= X-Received: by 2002:a17:90a:8c84:: with SMTP id b4mr5369914pjo.21.1615411290037; Wed, 10 Mar 2021 13:21:30 -0800 (PST) Received: from 42.do-not-panic.com (42.do-not-panic.com. [157.230.128.187]) by smtp.gmail.com with ESMTPSA id m7sm251819pjc.54.2021.03.10.13.21.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Mar 2021 13:21:29 -0800 (PST) Received: by 42.do-not-panic.com (Postfix, from userid 1000) id 15DC24024E; Wed, 10 Mar 2021 21:21:28 +0000 (UTC) Date: Wed, 10 Mar 2021 21:21:28 +0000 From: Luis Chamberlain To: Minchan Kim Cc: ngupta@vflare.org, sergey.senozhatsky.work@gmail.com, axboe@kernel.dk, mbenes@suse.com, 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: <20210310212128.GR4332@42.do-not-panic.com> References: <20210306022035.11266-1-mcgrof@kernel.org> <20210306022035.11266-2-mcgrof@kernel.org> 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 Mon, Mar 08, 2021 at 06:55:30PM -0800, Minchan Kim wrote: > If I understand correctly, bugs you found were related to module > unloading race while the zram are still working. No, that is a simplifcation of the issue. The issue consists of two separate issues: a) race against module unloading in light of incorrect racty use of cpu hotplug multistate support b) module unload race with sysfs attribute race on *any* driver which has sysfs attributes which also shares the same lock as used during module unload It is important to realize that issue b) is actually a generic kernel issue, it would be present on *any* driver which shares a lock used on a sysfs attribute and module unload. I looked to implement a generic solution on kernfs, however we don't yet have semantics to enable this generically, and so for now each driver needs to deal with those races on their own. That sysfs race is dealt with in the second patch. The first patch only deals with the cpu hotplug races exposed at module unloading. Luis