Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp2928169imm; Thu, 24 May 2018 19:13:56 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrQULVr3cUZ+OUpDuQlnMihxTk3EpWQDMV5mabY373tOUZ53D8Qp8HveeWKe47APiYmHWsd X-Received: by 2002:a65:5d51:: with SMTP id e17-v6mr427033pgt.100.1527214435994; Thu, 24 May 2018 19:13:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527214435; cv=none; d=google.com; s=arc-20160816; b=b40ooaCS7TKBlLSfvFMoHFZIHIE/YXcIPN0i2RzS7oEGnvJzQo+uhPV+J7mjnkspaj HcAQSeBRq8A729JIZXxtdYEyUSFo5UyRwhI8Qjkfm40aMy5tw6ho3oX/aZjN/3aWe9A+ WZZb17fcfpr4+g6vZSs3wYYzQy55FPLtsbu6CKBXLpTG3U+nqf6V7uxtHKVVm5k0IqSQ OrA1hDanPP32r8TK8Q9vO552SV8JpG5uA/SA2t/7nHs4QHzgbPDmsjuIRqm5ojU8PeUM 61VVUo2NBIBkMVqdTZL1x/jh8r6aaZXPqLPCKJH8wi6kBu7yoCmxPQoBgcVCDmNrwnlU LLAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=RgvyyHIXyp7ch65Q6rupSmQNBNgxxCo+qwE9aq6u7FE=; b=gzyWub1WHX783rDOst7aVRh+nIYWBfYwWkrHWjwaM61fLFiNB70x0c5dz/30UmuCns fWlTvC4ECCMlfQJpk5O5E787CCFSRlQreij8yqHiyDf+UcMoQ1zDbelo0RJU02RT9z3r VThrsMef1oPoQAORibqNiAs0LF9td4rONlzzCToGVioe9Wojw5YGGkR7Jit5FAK9Cn8F bGUDqLof1hoGz4gYAN2MHyKysH3dcFP4FrPGJba9GfUKZ0CjmE//FYHi++hJEwIVyzGi Y01re8gA/adVy1N9v+J/rSIIXYeuVxQ+2Vc936N1OT4JbDPgOyo+W/2nqJNe4BpmmcsE GGig== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n11-v6si11681374pgs.404.2018.05.24.19.13.41; Thu, 24 May 2018 19:13:55 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965858AbeEXOj7 (ORCPT + 99 others); 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 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext-too.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id A3E4AAD0B; Thu, 24 May 2018 14:39:55 +0000 (UTC) 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 Precedence: bulk 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