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 X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 43B6EC2D0EA for ; Thu, 9 Apr 2020 07:59:33 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 4EB4C20678 for ; Thu, 9 Apr 2020 07:59:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4EB4C20678 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id E03508E000D; Thu, 9 Apr 2020 03:59:31 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DB4878E0006; Thu, 9 Apr 2020 03:59:31 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CA2D38E000D; Thu, 9 Apr 2020 03:59:31 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0180.hostedemail.com [216.40.44.180]) by kanga.kvack.org (Postfix) with ESMTP id BDD2C8E0006 for ; Thu, 9 Apr 2020 03:59:31 -0400 (EDT) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 93864247A for ; Thu, 9 Apr 2020 07:59:31 +0000 (UTC) X-FDA: 76687566942.18.legs99_18efc17c14059 X-HE-Tag: legs99_18efc17c14059 X-Filterd-Recvd-Size: 4997 Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) by imf24.hostedemail.com (Postfix) with ESMTP for ; Thu, 9 Apr 2020 07:59:31 +0000 (UTC) Received: by mail-wm1-f67.google.com with SMTP id z6so3190291wml.2 for ; Thu, 09 Apr 2020 00:59:31 -0700 (PDT) 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=7aTkrJXqv2ZbDFk7CEzBnxc6D6u1o+Ia6P0f4mFbFV8=; b=ZuaPugTw+pHMbSmH9x4l0gjQKtbyKjvXsNut4OEzjBvP5w3m1jt9imlb89GIla9kRB oDNj9wW880PaTTVvHkx/8eR8ps8vTgENvuVLvP8Fmqr3V8D1L4rhjB1Xg2VAOYcJJNwG 6cPkIsrnZXP2a6tlQJMxJCPHv0+7cZ2zs1EGBAr5PSKAfRXDogsS8oXMEv5lGrcKXXH0 IY0h/L1R4EeFh4p4yE8n5kGOs0KVQrmuk1EfIO+ZB1w6HaQC0ZUp4D4mxV//5IfOD084 yiWZqrMYsdrrZRfckA8uXBeCfyheJA3MJL1vvxIzgXmo0df9djtEYgkw/ET3W92Gcx9X vs1g== X-Gm-Message-State: AGi0PuYoTkrXKXN009Gc8anLFChynAMCb4+waN4iWRWwV8ycCH0915ID V8oqvvhpQCJ2eExFOty3btpl2fAu X-Google-Smtp-Source: APiQypLF3rX8q4/0ETJueh+0y6VY0OOa4Qm9U2dPCpWP+b4Cb0cvwVi9cfda2DXukoQvwZZcCvJTsQ== X-Received: by 2002:a7b:c8cd:: with SMTP id f13mr9019734wml.181.1586419170075; Thu, 09 Apr 2020 00:59:30 -0700 (PDT) Received: from localhost (ip-37-188-180-223.eurotel.cz. [37.188.180.223]) by smtp.gmail.com with ESMTPSA id b82sm2901790wmh.1.2020.04.09.00.59.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Apr 2020 00:59:28 -0700 (PDT) Date: Thu, 9 Apr 2020 09:59:27 +0200 From: Michal Hocko To: Michael Ellerman Cc: David Hildenbrand , linux-kernel@vger.kernel.org, linux-mm@kvack.org, linuxppc-dev@lists.ozlabs.org, Nathan Fontenot , Benjamin Herrenschmidt , Paul Mackerras , Andrew Morton , Oscar Salvador , Baoquan He , Wei Yang Subject: Re: [PATCH v1 1/2] powerpc/pseries/hotplug-memory: stop checking is_mem_section_removable() Message-ID: <20200409075927.GC18386@dhcp22.suse.cz> References: <20200407135416.24093-1-david@redhat.com> <20200407135416.24093-2-david@redhat.com> <87sghdjf1y.fsf@mpe.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87sghdjf1y.fsf@mpe.ellerman.id.au> 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 Thu 09-04-20 17:26:01, Michael Ellerman wrote: > David Hildenbrand writes: > > > In commit 53cdc1cb29e8 ("drivers/base/memory.c: indicate all memory > > blocks as removable"), the user space interface to compute whether a memory > > block can be offlined (exposed via > > /sys/devices/system/memory/memoryX/removable) has effectively been > > deprecated. We want to remove the leftovers of the kernel implementation. > > > > When offlining a memory block (mm/memory_hotplug.c:__offline_pages()), > > we'll start by: > > 1. Testing if it contains any holes, and reject if so > > 2. Testing if pages belong to different zones, and reject if so > > 3. Isolating the page range, checking if it contains any unmovable pages > > > > Using is_mem_section_removable() before trying to offline is not only racy, > > it can easily result in false positives/negatives. Let's stop manually > > checking is_mem_section_removable(), and let device_offline() handle it > > completely instead. We can remove the racy is_mem_section_removable() > > implementation next. > > > > We now take more locks (e.g., memory hotplug lock when offlining and the > > zone lock when isolating), but maybe we should optimize that > > implementation instead if this ever becomes a real problem (after all, > > memory unplug is already an expensive operation). We started using > > is_mem_section_removable() in commit 51925fb3c5c9 ("powerpc/pseries: > > Implement memory hotplug remove in the kernel"), with the initial > > hotremove support of lmbs. > > It's also not very pretty in dmesg. > > Before: > > 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" Yeah, there is more output but isn't that useful? Or put it differently what is the actual problem from having those messages in the kernel log? >From the below you can clearly tell that there are kernel allocations which prevent hot remove from happening. If the overall size of the debugging output is a concern then we can think of a way to reduce it. E.g. once you have a couple of pages reported then all others from the same block are likely not interesting much. -- Michal Hocko SUSE Labs