From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id D731DC433FE for ; Tue, 1 Feb 2022 08:16:16 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 45CBD6B0173; Tue, 1 Feb 2022 03:16:16 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 40CD36B0174; Tue, 1 Feb 2022 03:16:16 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2ADE26B0175; Tue, 1 Feb 2022 03:16:16 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0183.hostedemail.com [216.40.44.183]) by kanga.kvack.org (Postfix) with ESMTP id 1C1B96B0173 for ; Tue, 1 Feb 2022 03:16:16 -0500 (EST) Received: from smtpin16.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id C3B7298C0F for ; Tue, 1 Feb 2022 08:16:15 +0000 (UTC) X-FDA: 79093503510.16.F9964A1 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf24.hostedemail.com (Postfix) with ESMTP id 3030F180002 for ; Tue, 1 Feb 2022 08:16:15 +0000 (UTC) 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-466-H8-6BDs2ODGGcZ3g6CdQRw-1; Tue, 01 Feb 2022 03:16:13 -0500 X-MC-Unique: H8-6BDs2ODGGcZ3g6CdQRw-1 Received: by mail-ed1-f72.google.com with SMTP id v15-20020a50a44f000000b004094f4a8f3bso8310133edb.0 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=3q3qa8bWiEq7jBRATDI2YhxcO5Jf38EUf9M90hjE5v3kUMhXcCu2cAToSIOCb1WBBV IiJ5dGFMscRd8OJSzNqHAJx1CrMOIAcVAqlj2zFiYt7FIyCTFl2o0uIM/ySZP6l59GYU AjbdYG0/1w7iB3ttVoYoEuHsHAh9aT9D6MOIDr2h6LqhsLyv2Y87HC1tKUcPzqSh6Cfr z0sHSv8kjSDUiC2KwIQAv8lZ9OTEqPypnUwK30LYC1oFLXNVsp41RayQtaLhfNw/PTbg P0QlrE1WTRDjL5aqfpuO1bEySjobxCwZwjwk0CUFjqF2DRLiWjcn3QGV41TzJynqZTPX Pr9Q== X-Gm-Message-State: AOAM531IEJ6E27xsl1I3JfwVkmOk7uZUrVzYiizGb3UevgOcNEU2x3Cr J/va/NlbMH+Ahbz4OzymnXsyN44tOkk2O3CdSvYu5ygd3ex+modbImmInjPJiorfbIT87SueEET YxGz6gd8NHV4= X-Received: by 2002:aa7:db8f:: with SMTP id u15mr23878841edt.36.1643703372250; Tue, 01 Feb 2022 00:16:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJwamLK6ay27bqiSrVmgRcJ7JB3jtltO7wdzb/R1xyMI58jT5fc1iRd1ruBPTJB8FcSJ0H18yA== 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 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> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 3030F180002 X-Stat-Signature: bckfxt4pxodsg7su4mbnbcpt1b163twb Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=TV2v7tl1; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf24.hostedemail.com: domain of david@redhat.com has no SPF policy when checking 170.10.133.124) smtp.mailfrom=david@redhat.com X-Rspam-User: nil X-HE-Tag: 1643703375-993538 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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