Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp1263955pxb; Wed, 2 Feb 2022 00:22:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJzXRHY3mAaJv7yz23SWHxKLSeKGZRzJyQnNKmau628SHtDekrNSB1vaRBWkU7tZKl5IueTr X-Received: by 2002:a05:6a00:1256:: with SMTP id u22mr29288353pfi.82.1643790138334; Wed, 02 Feb 2022 00:22:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643790138; cv=none; d=google.com; s=arc-20160816; b=XGglK33wHFjsrLCYrBajMUYOKwg1U1GVsgDbZlSb0H0j7Qqx8KcAq/loug1yL6rqOb xLoctBPZWBp9mGT/pJil6iS97YeV4FA2zEvGQzmOD2zBL+ifAdBxYcvsvIyGzvSaNQ5O DAL/sJOgCHhMMVERDGogMsJgXD6EB2FPALl1JiT1nQdOewWhVZ+V8q0GCZeTiIj2+hiu iQW4QMh6VCQRWauw+0uWmEcKZuHQDq8FaA/ajLblpsnUca27v4jIxhrzC4xooHLzjqLF taxYThRQzzGhYCG61Ek/IMqQYcVaomvqGuO9Qm8E3Nx1ArBNRIbOd3G6tDjJ0QUgS7aX 9qLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :organization:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:dkim-signature; bh=iF9w/EWzbcab7CEp+886dB7LcQJEOM9pY9E+Ls1yiTc=; b=KgejhvBP/SZIVPC0MOBLp7dbhNSYR6lTxH1/x3Kh/m/SAIuCPy83UfzbZce5QrB9j1 VjE7hhKybqMLrX5R9CBvI7psMyomijLpIYxwvChWSdcsYufmHyti4zTEe8MamG33uZ4Y wdE2jasxNvrzVX1D8Y3feFNgfoP2Bmn5MTCoEo08bCAieiYTU117ccNd/l518ZStVL79 Gq5oTbgf58J7rrA/zoyrLZ7sSZbnrOwEzZib7MMp4w5R93BOd5z+MzIO8A4EUTnlW3k1 nZWfwnqAS4HUi0Hm9DsL1iun7exjetj+wUelctoI2gkuADru0yUjex4PbqiXdhrSU73e hW+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=TV2v7tl1; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n4si18110691pfd.162.2022.02.02.00.22.05; Wed, 02 Feb 2022 00:22:18 -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=@redhat.com header.s=mimecast20190719 header.b=TV2v7tl1; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235361AbiBAIQQ (ORCPT + 99 others); Tue, 1 Feb 2022 03:16:16 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:37442 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230491AbiBAIQP (ORCPT ); Tue, 1 Feb 2022 03:16:15 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1643703374; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=iF9w/EWzbcab7CEp+886dB7LcQJEOM9pY9E+Ls1yiTc=; b=TV2v7tl1Zvt9iVoN6V4YOl+wiL5JKoZaHumc5lttzuhncCwRYf9ktyUhiJ83wX52MpqgPA B9Khprja1jKg9mZ3F9grJ5w3bh3mTvElv0b1ysL/KbzCgKY/fS+lXpCdFYYxYceF6ITXnI GUv5UguLbukFDr6LoCWa0um0wiBoHLI= Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-31-mxdZkSWGPBObDAurRi-dJQ-1; Tue, 01 Feb 2022 03:16:13 -0500 X-MC-Unique: mxdZkSWGPBObDAurRi-dJQ-1 Received: by mail-ed1-f72.google.com with SMTP id bc24-20020a056402205800b00407cf07b2e0so8312341edb.8 for ; Tue, 01 Feb 2022 00:16:13 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:organization:in-reply-to :content-transfer-encoding; bh=iF9w/EWzbcab7CEp+886dB7LcQJEOM9pY9E+Ls1yiTc=; b=drtax22yIievYpN1p2dUqvLaVmTQE5hJ2WdDd98vcL4LGlzW2eFyUk2GfAMGjapgd7 ujK1lwIca/QH55KBSWavQGEs8W1fptkG6duFUVUgKOv2CvNkrprw8r7SmOn79Dm0GGLL JgmZYo7xseG+aQzSHvAta15qFXhwyZ/hG6843XkfVhiXMhQCs6ISPCBNhdEP+Egx2NIZ ZogBIEhZA3LMhl6eh/s42cS4BcqC6PVF6lpsdvmfKG48eGFNbm7RltZoxxyvQAXGfyMW HYGJ/wDcCEGJs/m46KoKK8jQiUEas5U3GImnALrJactF9RdQ9D4HlX69Ol+HvnrGPCbI hKoA== X-Gm-Message-State: AOAM532EC7JNP0azmsgYXyO8vR7ur65kk4d+iHY0pC9FENlAYObiJba1 igoI/m4Xh7VeZFXUsodgZc67iuS9N8kXRForxysaZ/jjJhUPqWMwrjYm6Q2UDbolDtkP/Y32gug wQ7DJTkLvOnQtboiZjRoP3pFu X-Received: by 2002:aa7:db8f:: with SMTP id u15mr23878845edt.36.1643703372250; Tue, 01 Feb 2022 00:16:12 -0800 (PST) X-Received: by 2002:aa7:db8f:: with SMTP id u15mr23878827edt.36.1643703372010; Tue, 01 Feb 2022 00:16:12 -0800 (PST) Received: from ?IPV6:2003:cb:c711:ba00:67b6:a3ab:b0a8:9517? (p200300cbc711ba0067b6a3abb0a89517.dip0.t-ipconnect.de. [2003:cb:c711:ba00:67b6:a3ab:b0a8:9517]) by smtp.gmail.com with ESMTPSA id t27sm14169757ejd.168.2022.02.01.00.16.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 01 Feb 2022 00:16:11 -0800 (PST) Message-ID: Date: Tue, 1 Feb 2022 09:16:09 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.4.0 Subject: Re: [PATCH v1] drivers/base/memory: add memory block to memory group after registration succeeded Content-Language: en-US To: Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, stable@vger.kernel.org, Greg Kroah-Hartman , "Rafael J. Wysocki" , Michal Hocko , Oscar Salvador References: <20220128144540.153902-1-david@redhat.com> <20220131170123.42d7f46ecea0da1cb1579113@linux-foundation.org> From: David Hildenbrand Organization: Red Hat In-Reply-To: <20220131170123.42d7f46ecea0da1cb1579113@linux-foundation.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01.02.22 02:01, 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. Triggering that registration error is fairly hard, usually we fail memory hotplug because we fail to allocate the (largish) memmap. So I am not aware that this BUG actually triggered. -- Thanks, David / dhildenb