Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1381553ybb; Thu, 9 Apr 2020 00:33:50 -0700 (PDT) X-Google-Smtp-Source: APiQypKWZMTIlfak1GN4rpaPIDJnfdY7BjbLRkCtK8X6Gh0HN3AGKU8zJyp1pAGqsaZb0I7NGkF1 X-Received: by 2002:aca:5193:: with SMTP id f141mr835993oib.66.1586417630187; Thu, 09 Apr 2020 00:33:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586417630; cv=none; d=google.com; s=arc-20160816; b=gGAg580HaXqz6v20EAzfCJBoH1FDABU/Rz8uQXugYnLdybDmWCruBdcBDos+oOMLA3 ASCuaJr9iKadmLVNk6BqbL8Yzbklc9Ng+UtgveYC9/X1IT/BoGAk0F4bKc+l7brhcvEN 9uzFgGjKHCKNJOxRoSrXi8f8jkPEfs1tHSklUsQ11dUt6b7/k+AyxtvhHH2rZ2TsdCZg BApJ8WIeCZo9UrOYFjbOK6I3ZhaV/BJRxP8DZzotj5123oKBvMsbcCR/+iRFaBTF57qo Sb2Q8KPrfoB4vMExOvb0u72zueR988n5Y6RqVjOYO77ckVa8NuxDBRQ1kPY17RiWKnbu LfqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:autocrypt:from:references:cc:to:subject :dkim-signature; bh=Y6qMltfal0fl2P6YWyS5WSepv82iHZRo2B97emGwRs0=; b=qCGr0LrE2b8JngX+0hdUBLDSEVxku2cy/veopcGp8gfT9iWEkHuYvfbQUspdFgo9VZ rPFINoDd584B7qvO4XhDp46e57/3UqNPRhbl9ghDmyHa/tWUvthrpj7t0f/z9jm097OD jIFPWjbhPjCFYx3wLLi8I8HKWrFFXzraXZubKBuqiEiI97muAV8tbPKytfNSSrOrWdsB McNee8fW6bUl8t6FQvNGyoddf/RBHaZTl2PgIUl4ZUBmhReRC5TXB+F3R7U04gLutzfh w1HYhUr8CtE325uVItTqPGpFAWdKQkvQmmI3vfR9s3/g7AiJ/tXfvoQNiwm+BOnqC9Fq jf2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=dLMse1UF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z12si3540828otk.227.2020.04.09.00.33.34; Thu, 09 Apr 2020 00:33:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=dLMse1UF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1726521AbgDIHcw (ORCPT + 99 others); Thu, 9 Apr 2020 03:32:52 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:58090 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725970AbgDIHcw (ORCPT ); Thu, 9 Apr 2020 03:32:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1586417570; 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:autocrypt:autocrypt; bh=Y6qMltfal0fl2P6YWyS5WSepv82iHZRo2B97emGwRs0=; b=dLMse1UFomkw9Q8Swyo7ez1wCIoenLrf9YcA8fFLI3NQNZKH2xbmn+KpXGhBHRuBezhTQE SEEqiV1QcxEf5H5sMrgz3fgseksnUJ3Sy1LWtiBzcip+tTbEd4A2rjEKWpYZcehcfNxjFB C5Sg1jAREkty/m5bPs43WtKxi5weS5M= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-399-NPJ8xQUvMS2eCihXJ5X4LQ-1; Thu, 09 Apr 2020 03:32:46 -0400 X-MC-Unique: NPJ8xQUvMS2eCihXJ5X4LQ-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 107578018CD; Thu, 9 Apr 2020 07:32:45 +0000 (UTC) Received: from [10.36.113.222] (ovpn-113-222.ams2.redhat.com [10.36.113.222]) by smtp.corp.redhat.com (Postfix) with ESMTP id A0681A0A7B; Thu, 9 Apr 2020 07:32:42 +0000 (UTC) Subject: Re: [PATCH v1 1/2] powerpc/pseries/hotplug-memory: stop checking is_mem_section_removable() To: Michael Ellerman , linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, linuxppc-dev@lists.ozlabs.org, Nathan Fontenot , Benjamin Herrenschmidt , Paul Mackerras , Michal Hocko , Andrew Morton , Oscar Salvador , Baoquan He , Wei Yang References: <20200407135416.24093-1-david@redhat.com> <20200407135416.24093-2-david@redhat.com> <87sghdjf1y.fsf@mpe.ellerman.id.au> From: David Hildenbrand Autocrypt: addr=david@redhat.com; prefer-encrypt=mutual; keydata= mQINBFXLn5EBEAC+zYvAFJxCBY9Tr1xZgcESmxVNI/0ffzE/ZQOiHJl6mGkmA1R7/uUpiCjJ dBrn+lhhOYjjNefFQou6478faXE6o2AhmebqT4KiQoUQFV4R7y1KM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AiUEGAECAA8FAlXLn5ECGwwFCQlmAYAACgkQTd4Q 9wD/g1qA6w/+M+ggFv+JdVsz5+ZIc6MSyGUozASX+bmIuPeIecc9UsFRatc91LuJCKMkD9Uv GOcWSeFpLrSGRQ1Z7EMzFVU//qVs6uzhsNk0RYMyS0B6oloW3FpyQ+zOVylFWQCzoyyf227y GW8HnXunJSC+4PtlL2AY4yZjAVAPLK2l6mhgClVXTQ/S7cBoTQKP+jvVJOoYkpnFxWE9pn4t H5QIFk7Ip8TKr5k3fXVWk4lnUi9MTF/5L/mWqdyIO1s7cjharQCstfWCzWrVeVctpVoDfJWp 4LwTuQ5yEM2KcPeElLg5fR7WB2zH97oI6/Ko2DlovmfQqXh9xWozQt0iGy5tWzh6I0JrlcxJ ileZWLccC4XKD1037Hy2FLAjzfoWgwBLA6ULu0exOOdIa58H4PsXtkFPrUF980EEibUp0zFz GotRVekFAceUaRvAj7dh76cToeZkfsjAvBVb4COXuhgX6N4pofgNkW2AtgYu1nUsPAo+NftU CxrhjHtLn4QEBpkbErnXQyMjHpIatlYGutVMS91XTQXYydCh5crMPs7hYVsvnmGHIaB9ZMfB njnuI31KBiLUks+paRkHQlFcgS2N3gkRBzH7xSZ+t7Re3jvXdXEzKBbQ+dC3lpJB0wPnyMcX FOTT3aZT7IgePkt5iC/BKBk3hqKteTnJFeVIT7EC+a6YUFg= Organization: Red Hat GmbH Message-ID: <82376163-412f-e5bc-65f0-a37c129ecdf2@redhat.com> Date: Thu, 9 Apr 2020 09:32:41 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <87sghdjf1y.fsf@mpe.ellerman.id.au> Content-Type: text/plain; charset=windows-1252 Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > It's also not very pretty in dmesg. >=20 > Before: >=20 > pseries-hotplug-mem: Attempting to hot-add 10 LMB(s) > pseries-hotplug-mem: Memory hot-add failed, removing any added LMBs > dlpar: Could not handle DLPAR request "memory add count 10" >=20 Thanks for running it through the mill. Here you test "hotadd", below you test "hot-remove". But yeah, there is a change in the amount of dmesg. > After: >=20 > pseries-hotplug-mem: Attempting to hot-remove 10 LMB(s) > page:c00c000001ca8200 refcount:1 mapcount:0 mapping:0000000018c4a547 = index:0xc00000072a080180 > flags: 0x7ffff000000200(slab) > raw: 007ffff000000200 c00c000001cffd48 c000000781c51410 c000000793327= 580 > raw: c00000072a080180 0000000001550001 00000001ffffffff 0000000000000= 000 > page dumped because: unmovable page > page:c00c000001cc4a80 refcount:1 mapcount:0 mapping:0000000018c4a547 = index:0xc00000079b110080 > flags: 0x7ffff000000000() > raw: 007ffff000000000 5deadbeef0000100 5deadbeef0000122 0000000000000= 000 > raw: c00000079b110080 0000000000000000 00000001ffffffff 0000000000000= 000 > page dumped because: unmovable page > page:c00c000001d08200 refcount:1 mapcount:0 mapping:0000000018c4a547 = index:0xc00000074208ff00 > flags: 0x7ffff000000200(slab) > raw: 007ffff000000200 c000000781c5f150 c00c000001d37f88 c000000798a24= 880 > raw: c00000074208ff00 0000000001550002 00000001ffffffff 0000000000000= 000 > page dumped because: unmovable page > page:c00c000001d40140 refcount:1 mapcount:0 mapping:0000000018c4a547 = index:0xc000000750059c00 > flags: 0x7ffff000000200(slab) > raw: 007ffff000000200 c00c000001dfcfc8 c00c000001d3c288 c0000007851c2= d00 > raw: c000000750059c00 0000000001000003 00000001ffffffff 0000000000000= 000 > page dumped because: unmovable page > page:c00c000001d9c000 refcount:1 mapcount:0 mapping:0000000018c4a547 = index:0xc000000002370080 > flags: 0x7ffff000000000() > raw: 007ffff000000000 5deadbeef0000100 5deadbeef0000122 0000000000000= 000 > raw: c000000002370080 0000000000000000 00000001ffffffff 0000000000000= 000 > page dumped because: unmovable page > page:c00c000001dc0200 refcount:1 mapcount:0 mapping:0000000018c4a547 = index:0xc000000002370080 > flags: 0x7ffff000000000() > raw: 007ffff000000000 5deadbeef0000100 5deadbeef0000122 0000000000000= 000 > raw: c000000002370080 0000000000000000 00000001ffffffff 0000000000000= 000 > page dumped because: unmovable page > page:c00c000001e00000 refcount:1 mapcount:0 mapping:0000000018c4a547 = index:0x0 > flags: 0x7ffff000000200(slab) > raw: 007ffff000000200 5deadbeef0000100 5deadbeef0000122 c0000007a801f= 500 > raw: 0000000000000000 0000000008000800 00000001ffffffff 0000000000000= 000 > page dumped because: unmovable page > page:c00c000001e40440 refcount:1 mapcount:0 mapping:0000000018c4a547 = index:0x0 > flags: 0x7ffff000000200(slab) > raw: 007ffff000000200 5deadbeef0000100 5deadbeef0000122 c0000007a801e= 380 > raw: 0000000000000000 0000000000400040 00000001ffffffff 0000000000000= 000 > page dumped because: unmovable page > page:c00c000001e80000 refcount:1 mapcount:0 mapping:0000000018c4a547 = index:0xc0000007a0000640 > flags: 0x7ffff000000200(slab) > raw: 007ffff000000200 c00c000001e5af48 c00c000001e80408 c000000f42d00= a00 > raw: c0000007a0000640 00000000066600a2 00000001ffffffff 0000000000000= 000 > page dumped because: unmovable page > page:c00c000003c89d40 refcount:2 mapcount:1 mapping:0000000018c4a547 = index:0x10a41 > anon flags: 0x17ffff000080024(uptodate|active|swapbacked) > raw: 017ffff000080024 5deadbeef0000100 5deadbeef0000122 c0000007986b0= 3c9 > raw: 0000000000010a41 0000000000000000 0000000200000000 c00000000340b= 000 > page dumped because: unmovable page > page->mem_cgroup:c00000000340b000 > page:c00c000003cc0000 refcount:1 mapcount:0 mapping:0000000018c4a547 = index:0xc000000f3000fd38 > flags: 0x17ffff000000200(slab) > raw: 017ffff000000200 c000000f3c911890 c000000f3c911890 c00000079fffd= 980 > raw: c000000f3000fd38 0000000000700003 00000001ffffffff 0000000000000= 000 > page dumped because: unmovable page > page:c00c000003d00000 refcount:1 mapcount:0 mapping:0000000018c4a547 = index:0xc0000007a2ec0000 > flags: 0x17ffff000000000() > raw: 017ffff000000000 5deadbeef0000100 5deadbeef0000122 0000000000000= 000 > raw: c0000007a2ec0000 0000000000000000 00000001ffffffff 0000000000000= 000 > page dumped because: unmovable page > page:c00c000003e2c000 refcount:1 mapcount:0 mapping:0000000018c4a547 = index:0xc000000f8b008400 > flags: 0x27ffff000000200(slab) > raw: 027ffff000000200 c000000f8e000190 c000000f8e000190 c0000007a801e= 380 > raw: c000000f8b008400 0000000000400038 00000001ffffffff 0000000000000= 000 > page dumped because: unmovable page > page:c00c000003fec000 refcount:1 mapcount:0 mapping:0000000018c4a547 = index:0x0 > flags: 0x37ffff000000000() > raw: 037ffff000000000 5deadbeef0000100 5deadbeef0000122 0000000000000= 000 > raw: 0000000000000000 0000000000000000 00000001ffffffff 0000000000000= 000 > page dumped because: unmovable page > pseries-hotplug-mem: Memory hot-remove failed, adding LMB's back > dlpar: Could not handle DLPAR request "memory remove count 10" >=20 >=20 >=20 > It looks like set_migratetype_isolate() and start_isolate_page_range() > can be told not to report those warnings, but we're just calling > device_offline() which doesn't let us specify that. Yeah, but these messages can easily pop up (to a more limited degree) with the current code as well, as checking for movable pages without isolating the page range gives you no guarantees that no unmovable data will end up on the lmb until you offline it. It's simply racy. I discussed this output with Michal when we changed the /sys/devices/system/memory/memoryX/removable behavior, and he had the opinion that dmesg (debug) output should not really be an issue. We could make this output a) configurable at runtime and let powerpc code disable it while calling device_offline(). So user space attempts will still trigger the messages b) configurable at compile time --=20 Thanks, David / dhildenb