Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp1331426pxb; Wed, 2 Feb 2022 02:27:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJzPeC5DFK9ZIfN2u06DokoBVD9vRluyywXld5aVPuZu6T/hAhK5BjV5VS0O7FFo8TE+tkz+ X-Received: by 2002:a63:358c:: with SMTP id c134mr24095736pga.116.1643797641558; Wed, 02 Feb 2022 02:27:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643797641; cv=none; d=google.com; s=arc-20160816; b=fJ7XhtcgSc0ss7/TLhROOtR7tSbp+VuzbzFqc3ghOIVU0BH1D1QZtgDHihJcXjZQEe tzJk3IyiZxCdGQJ0CCdcIdgG90J42J6Ie98a3rRcFKOe4DOLII598U6EyOUqem9ySKk3 3y9KGSnUf5DCfd6vrJGQKvhKkIPg/ND9J/IxWZef+LXJOIfaC6+V0iko//QI5j+1GLQ8 DnVcqjV9QZ4VugaZ9ovynHx0DIV86CRHmdJ3jpBZckOVdOWW279NmaewWeIkcPlera2s WrQkFWFZfccvGlZjuhkPEw/+9d5udVKcWrBICGnjhcsuNkPSXp8VQTZ9jZIHUCg8lwUE GATw== 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:dkim-signature; bh=u81yjtGgwbF764LyCgpsfndB5V+V815DjFHEVDCtnLk=; b=t/JeSiaaZpUXNCFHhZ1oGXJkjfhJ8vbtzN/gKZmmHe7pGbNnmKLIgakE+2E8OPWSSX 2edmZwIH64hFydMqAMmX/ZhtqEXBA6sEfbKy7YgQ9L7D8PzgqlDtisACkKCodnf2fWCt MM8yOaifuftfAAs4JYVnd1eOAwn6z8yPAtsjIURDlamFHMp3RKTAX6D74qTCDMI5+GRz wLdefAC9rTa7a27+rnKwg7HJqLzJCRG786apjSkompQYGyV3v0dJGzDScBjr06hHnC1H NMlSKqHxs9sUQzTNT3QsAjJX6/ERPoptadmgC9eqIwcppaBJjzP14cPBf/Kw9F3hOIKl tYsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=gOTYVS85; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r201si20305021pgr.539.2022.02.02.02.27.09; Wed, 02 Feb 2022 02:27:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=gOTYVS85; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237813AbiBAMKw (ORCPT + 99 others); Tue, 1 Feb 2022 07:10:52 -0500 Received: from smtp-out1.suse.de ([195.135.220.28]:59134 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237799AbiBAMKv (ORCPT ); Tue, 1 Feb 2022 07:10:51 -0500 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 739D6212CC; Tue, 1 Feb 2022 12:10:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1643717450; 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=u81yjtGgwbF764LyCgpsfndB5V+V815DjFHEVDCtnLk=; b=gOTYVS85sYoQl61zNk8ZPC6pAokZuK2Dx+EIIepx2g7fHcUNYuGWmgeYr3dnYXM24BmPe9 +CdVFfiqf/L5o9jExG1tHnHhmQeJmN/vHo4evxcxs9ef5LmimGnb01OaxodO3armhAL7Vp p8xfHfsb4Sj1cJbBDMgTdSvXfiKBxvk= Received: from suse.cz (unknown [10.100.201.86]) (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 5BBFDA3B8B; Tue, 1 Feb 2022 12:10:50 +0000 (UTC) Date: Tue, 1 Feb 2022 13:10:50 +0100 From: Michal Hocko To: Andrew Morton Cc: David Hildenbrand , linux-kernel@vger.kernel.org, linux-mm@kvack.org, stable@vger.kernel.org, Greg Kroah-Hartman , "Rafael J. Wysocki" , Oscar Salvador Subject: Re: [PATCH v1] drivers/base/memory: add memory block to memory group after registration succeeded Message-ID: References: <20220128144540.153902-1-david@redhat.com> <20220131170123.42d7f46ecea0da1cb1579113@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220131170123.42d7f46ecea0da1cb1579113@linux-foundation.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon 31-01-22 17:01:23, Andrew Morton wrote: > On Fri, 28 Jan 2022 15:45:40 +0100 David Hildenbrand wrote: > > > If register_memory() fails, we freed the memory block but already added > > the memory block to the group list, not good. Let's defer adding the > > block to the memory group to after registering the memory block device. > > > > We do handle it properly during unregister_memory(), but that's not > > called when the registration fails. > > > > I guess this has never been known to happen. So I queued the fix for > 5.18-rc1, cc:stable. I do not think this is worth stable backporting. Chances of a failure are pretty small and I am not aware of any existing report. -- Michal Hocko SUSE Labs