From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965862AbeEXOj7 (ORCPT ); Thu, 24 May 2018 10:39:59 -0400 Received: from mx2.suse.de ([195.135.220.15]:40003 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965438AbeEXOj5 (ORCPT ); Thu, 24 May 2018 10:39:57 -0400 Date: Thu, 24 May 2018 16:39:53 +0200 From: Michal Hocko To: David Hildenbrand Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Greg Kroah-Hartman , Rashmica Gupta , Balbir Singh , Andrew Morton , Vlastimil Babka , Dan Williams , Joonsoo Kim , Pavel Tatashin , Reza Arbab , Thomas Gleixner Subject: Re: [PATCH v1 09/10] mm/memory_hotplug: teach offline_pages() to not try forever Message-ID: <20180524143953.GK20441@dhcp22.suse.cz> References: <20180523151151.6730-1-david@redhat.com> <20180523151151.6730-10-david@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180523151151.6730-10-david@redhat.com> User-Agent: Mutt/1.9.5 (2018-04-13) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [I didn't really go through other patch but this one caught my eyes just because of the similar request proposed yesterday] On Wed 23-05-18 17:11:50, David Hildenbrand wrote: [...] > @@ -1686,6 +1686,10 @@ static int __ref __offline_pages(unsigned long start_pfn, > pfn = scan_movable_pages(start_pfn, end_pfn); > if (pfn) { /* We have movable pages */ > ret = do_migrate_range(pfn, end_pfn); > + if (ret && !retry_forever) { > + ret = -EBUSY; > + goto failed_removal; > + } > goto repeat; > } > Btw. this will not work in practice. Even a single temporary pin on a page will fail way too easily. If you really need to control this then make it a retry counter with default -1UL. We really do need a better error reporting from do_migrate_range and distinguish transient from permanent failures. In general we shouldn't even get here for pages which are not migrateable... -- Michal Hocko SUSE Labs