Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2776049yba; Mon, 6 May 2019 11:19:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqzz6A7XUFob8LBsd8v5lUQXBRRBpykAgFs871pkQETbNZql9DgMeGsdbncD54KRBbrt84ew X-Received: by 2002:a63:3182:: with SMTP id x124mr25391992pgx.364.1557166785271; Mon, 06 May 2019 11:19:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557166785; cv=none; d=google.com; s=arc-20160816; b=HE148DuKlSB9Waw5O4th10f7YOs4eYJbmIVDsnbp7SaXhm1nI9G6vhxKEKNARl2AND JMp2wtQ5p7dq/SIm2JbiWxugsT2HyCWDCxBuOAmra0DVb4V3EgSLECVgRwZqtX0JTukj PJNg6gxTUzmPaih6z+NC/P6fMmuzoy6NoZLK7HmsCLaU7N8OFpk6Xt9JNw+895jqiHJO NtiuBwJfWO1nkK6SYvCyLBJkqjKUqDd0nnNZskdankiaH4m0ephxi+36Y5MuFNXuwURY 1nP5zyUsP1z74tpUZFoJosU1iPW2Ih3cTeHxCJSPj/TZLcsJM9qEW0SaWozo94q88kfp vDLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=HayB7sQuY+v6EOo4zgx5AzoxFFOqeB4N5OR8XF6r5Uc=; b=KPd2DVZJS9VNtRIMWjEuI2H5yVO83FVpWa3TkP08ga4a0lvURvAX0bz/M0APxW8Ix3 MMqqS8y+Az1GM8GFT2T72bX3z9KBo+vyie57nwY+ppBHqvS9GhYRNjvmxKLktrOd1osD qyDYAPwIP5ymqIDmAe0WPhoeM3ak6Ae69aSj1OULfEiP1Ds4k2DwW6XZwn/NmbGJ3sLK gA3+skM+KO7pw8GW1AH44Npxa0XErGpq+qD7go14VhWuFXeGmGv+gWeTblLfjez4SnE3 8uXHTYNQzpHO51arGMNpdGtO5ect5jy3WYqa28oZrkPJfA01uMzAnJG5NP0SP/y94MYx ptCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@soleen.com header.s=google header.b=ZO0IGp0O; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t9si1854054plq.396.2019.05.06.11.19.28; Mon, 06 May 2019 11:19:45 -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=@soleen.com header.s=google header.b=ZO0IGp0O; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726383AbfEFSSd (ORCPT + 99 others); Mon, 6 May 2019 14:18:33 -0400 Received: from mail-ed1-f44.google.com ([209.85.208.44]:37412 "EHLO mail-ed1-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726175AbfEFSSd (ORCPT ); Mon, 6 May 2019 14:18:33 -0400 Received: by mail-ed1-f44.google.com with SMTP id w37so16228066edw.4 for ; Mon, 06 May 2019 11:18:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=HayB7sQuY+v6EOo4zgx5AzoxFFOqeB4N5OR8XF6r5Uc=; b=ZO0IGp0OlSdXA+IWacCTnCe28YL0KDN5WLR0iOy2RQwLUXZVopK4KJfjY+7Q/z9X6s SjuXLmGb7eUbUPJHlvDgd+B3s08Ybui1oQ9ioaIhBcDsAz6stlJCXGs9JZSL5YKh43lu Nwu+fb1XhtGFgnaFbhK852KIcA+Hirr1L1Uu2CPoxojTIdKceAWJbAZ7TBO6HNLfSXLH IqZeQ9Y3ShvtCySSy+qfuIwbk91roy5qHtFp8zbKkADnaXx4F2yKU1KCdSog3LdNJZ0V /oPFwD9Z4Ilb/jEbM5g4Mp2y3Hs7tChLQ697C0ly3r+YHVZPXTFzV9DXetIRIhfLCKSy AKNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=HayB7sQuY+v6EOo4zgx5AzoxFFOqeB4N5OR8XF6r5Uc=; b=ZFu/xHdKqpWYdoJEhgwcsVu3B5y51HRXy2gF1PNYGm59UWQgcA2evCHBEbL82wnCe6 rAscL/beP9kpVzUgmgX8ze7hJggG5RluH0Vv4tIGmzUx/bl1tBL+YZ3RrUiwLxN9htYr eBNYAVSbJoaamyzDGhxM5dT0zb/kJtrTN3Gj0GlEo0LeIMYimpZKzvlR0Q0oIkO8q3PF 1pAJfxjScu1iatC+pjXKwi2dKuTDSho2ma7fSBDyNXV+mCshRfAuJ2tHw5YYfPFfRW7z lGmcyAKmKLdLujaFUAxZGD/i9mKcovG3s9wAYl7QLPJGkBEf9Bz9rsi2OHO6tSwtkQa/ ySLw== X-Gm-Message-State: APjAAAU/N0nRe97SDsxMTtjTZUCypG7uy9prSs4/3UVUfL6dhkgdnFLk /c9SJc7zOOrJsJag4zJArqOF+hksNamYWL9dVInSfg== X-Received: by 2002:a17:906:5c0f:: with SMTP id e15mr20354898ejq.151.1557166711352; Mon, 06 May 2019 11:18:31 -0700 (PDT) MIME-Version: 1.0 References: <20190502184337.20538-1-pasha.tatashin@soleen.com> <20190502184337.20538-3-pasha.tatashin@soleen.com> In-Reply-To: From: Pavel Tatashin Date: Mon, 6 May 2019 14:18:20 -0400 Message-ID: Subject: Re: [v5 2/3] mm/hotplug: make remove_memory() interface useable To: Dave Hansen Cc: Dan Williams , James Morris , Sasha Levin , Linux Kernel Mailing List , Linux MM , linux-nvdimm , Andrew Morton , Michal Hocko , Dave Hansen , Keith Busch , Vishal L Verma , Dave Jiang , Ross Zwisler , Tom Lendacky , "Huang, Ying" , Fengguang Wu , Borislav Petkov , Bjorn Helgaas , Yaowei Bai , Takashi Iwai , =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= , David Hildenbrand Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 6, 2019 at 2:04 PM Dave Hansen wrote: > > On 5/6/19 11:01 AM, Dan Williams wrote: > >>> +void __remove_memory(int nid, u64 start, u64 size) > >>> { > >>> + > >>> + /* > >>> + * trigger BUG() is some memory is not offlined prior to calling this > >>> + * function > >>> + */ > >>> + if (try_remove_memory(nid, start, size)) > >>> + BUG(); > >>> +} > >> Could we call this remove_offline_memory()? That way, it makes _some_ > >> sense why we would BUG() if the memory isn't offline. > > Please WARN() instead of BUG() because failing to remove memory should > > not be system fatal. > > That is my preference as well. But, the existing code BUG()s, so I'm > OK-ish with this staying for the moment until we have a better handle on > what all the callers do if this fails. Yes, this is the reason why I BUG() here. The current code does this, and I was not sure what would happen if we simply continue executing. Of course, I would prefer to return failure, so the callers can act appropriately, but let's make one thing at a time, this should not be part of this series. Thank you, Pasha