Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp457365img; Wed, 20 Mar 2019 04:22:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqwJ+TrwLAh41Js/EYG9ew/MuLRo5i12rfQ597tmvPo9uCt6EaXjj6f0sJlED/pIdelThicc X-Received: by 2002:a17:902:e912:: with SMTP id cs18mr2612588plb.130.1553080946410; Wed, 20 Mar 2019 04:22:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553080946; cv=none; d=google.com; s=arc-20160816; b=bMNHQoOepfGsQdnwWHDivcHH68vNCkGdA1U1AInZnGjjuieNwK4oGSMCk4GJM8ayhG aggnubcM8AQwzFMikFU+EN/5GkeT8uz7qKdyen13TgO7R/U6NTwDM77ZDl8t7saxsVHV VFHIAIVPL+5uN+J9X8KORw1lrIR6dhbruEXNr1TJkNfk9FdxlLkppREBh4qYIzBrsnc2 ASj35MkpThFVpjbI9+sk4Llg7WIvuaPurfw9thA611ea/KIG76SpWvWsW+QtPqg9cUB/ iUyd7th7lQ83HEEihZlefNucMyNdlDkt8ERAVTa+VbOq6y3cQO64eS6f1TwzFXp0uJ7X /VEw== 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:dkim-signature; bh=X0UZ2Ky/zStGHPaiYjOhz7nuC7+B3z5ZswtS2vYbX0k=; b=ufOoXfIrNk/jEYoY7//PKPi+PYh3THX77MFFJEBotyrPXwIIx1DAvY/vWy7DOGqgnp lmPLBAqxbmBJ25e6a0uhBWPEyGPNK+Tb7OrbU8TRMHUXj+OEW6v5/d3rropP1ZsmXxvU dCl+MWrKq0JVzpvHt8uXEbdlej6/0o2byO2Yd0Qkq4cdA+57epccTIpguGf+EvjYTVtP 96bR+nhovuijYbDms5fPHfz6Lxy649MYNAyJKp+kb/WuqxDGoKq+HHIItysQU5gjLlOn URZqYm324EhSryqIOrj8fozPh1hWZezC7dd+XU0xOS9QQP2bmDCujvfolW0x1x4QfOqj FGTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=P5Xhif6s; 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 b8si1794177pla.290.2019.03.20.04.22.09; Wed, 20 Mar 2019 04:22:26 -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=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=P5Xhif6s; 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 S1727522AbfCTLUA (ORCPT + 99 others); Wed, 20 Mar 2019 07:20:00 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:44156 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727154AbfCTLUA (ORCPT ); Wed, 20 Mar 2019 07:20:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=X0UZ2Ky/zStGHPaiYjOhz7nuC7+B3z5ZswtS2vYbX0k=; b=P5Xhif6soKuu27UyLw0TJwt/C g7xrtrWG+7HryAGydpaDjOzzLE9hFy3fvrjNfU6qMKF/chFBOkOCGxxmntD1+x0rR+bV4YU33Lh4Z SK4dVmHgpGdCjSvZrwf1xQ1ib9/Du59c0XiSCwlT/FRVBuPZYYkHS8dbNVCpPzrtnYzsoJQJKnIgf OB6sdGR8ndX/HMvYrV6Qtp9sRvO1cc++XFEwXrDujZN248gpAulDa0RZsHpRTWocZlWQsEGmCS0IY ReAOcRWeLdr0STaS8VT7lut7bUqEbKmpgPDfEPdX8qfcGO1SiABMYc/usMdt30poz+7CBpRiWBBHu oFlP3BEqQ==; Received: from willy by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1h6ZGJ-0005lm-Qz; Wed, 20 Mar 2019 11:19:59 +0000 Date: Wed, 20 Mar 2019 04:19:59 -0700 From: Matthew Wilcox To: Baoquan He Cc: linux-kernel@vger.kernel.org, akpm@linux-foundation.org, pasha.tatashin@oracle.com, mhocko@suse.com, rppt@linux.vnet.ibm.com, richard.weiyang@gmail.com, linux-mm@kvack.org Subject: Re: [PATCH 1/3] mm/sparse: Clean up the obsolete code comment Message-ID: <20190320111959.GV19508@bombadil.infradead.org> References: <20190320073540.12866-1-bhe@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190320073540.12866-1-bhe@redhat.com> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 20, 2019 at 03:35:38PM +0800, Baoquan He wrote: > /* > - * returns the number of sections whose mem_maps were properly > - * set. If this is <=0, then that means that the passed-in > - * map was not consumed and must be freed. > + * sparse_add_one_section - add a memory section > + * @nid: The node to add section on > + * @start_pfn: start pfn of the memory range > + * @altmap: device page map > + * > + * Return 0 on success and an appropriate error code otherwise. > */ I think it's worth documenting what those error codes are. Seems to be just -ENOMEM and -EEXIST, but it'd be nice for users to know what they can expect under which circumstances. Also, -EEXIST is a bad errno to return here: $ errno EEXIST EEXIST 17 File exists What file? I think we should be using -EBUSY instead in case this errno makes it back to userspace: $ errno EBUSY EBUSY 16 Device or resource busy