Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp1432239ybd; Wed, 26 Jun 2019 17:52:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqxpo44maZReExssnWPrBLuyLn9y7A1KOUilYNvykRYov9Qp1k9fz/TMYXoBUWX4JMbGqIaq X-Received: by 2002:a17:90a:32ed:: with SMTP id l100mr2402859pjb.11.1561596738536; Wed, 26 Jun 2019 17:52:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561596738; cv=none; d=google.com; s=arc-20160816; b=1LDILUJolIEAZU6agBJtSvQZc9Ueg/p8x4CewLAXNvpbp3nuOrGEpW11AH9Etkq8JR rSYO3TyvVj6y+E/SXZVKsr5x5dddg0WycSk0mYSexJHD6SXvfDoeC/FMEl01CIgb6fk+ IpM1MClPiHukNKs+1kEt2+78PIJKjRUJyOyiCVYewDfkza9QR4uqzmTP97z7b+cwkvlj Q2hLI6X9VWzTPhse3RHuCyf7YkUuljmwcIYrJ8DDO/VCMtaold6jzBHetxzbyN2fE1fA buNff39DmhW39T9tnSxXuYyXkRquWjOOFd8nipi9Ki7jMA0QVVSOXkvo8oDrCHdHiIOZ 3a5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:dkim-signature; bh=LoaYtMcAXKs6uO6gzAuujC0HF/HDtLH3jx83uKn7A+k=; b=FiFNGZsLAcAgLM85L3sVYY29vJFfXfJkrsqHBfE6Y4pj/vzXg2nM1XxYO/FaEvcT0z EKGdZC+Mhiz7nPS62RWwPXdPYg+zvFGKqd2OYlDF72GGxToPXMOQpwt5YsDgNzYIYxdm 5MTxTVtH7hndRA/1Ri2EshZx5zjsJ3efbnkQ9t7h3wHPprsF5FwRT5B1hynPXh9ziOoA ZFSf6cus5dYIDLmJ4cujz/9rBSctQKW7c9SJGAq2SNRWosxyhxllCCilLpSzzwKiSKCv Zv3WH4zLNM0Lcm0VOZZd8XuSJgUbMsrkB2sBdq+t4KmSx3Rw30QZVBaXGkUzusSeCvPY brgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@d-silva.org header.s=201810a header.b=Tl3RrQYL; 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 q24si851658pff.62.2019.06.26.17.52.02; Wed, 26 Jun 2019 17:52:18 -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=@d-silva.org header.s=201810a header.b=Tl3RrQYL; 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 S1727290AbfF0AvX (ORCPT + 99 others); Wed, 26 Jun 2019 20:51:23 -0400 Received: from ushosting.nmnhosting.com ([66.55.73.32]:60588 "EHLO ushosting.nmnhosting.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726820AbfF0AvV (ORCPT ); Wed, 26 Jun 2019 20:51:21 -0400 Received: from mail2.nmnhosting.com (unknown [202.169.106.97]) by ushosting.nmnhosting.com (Postfix) with ESMTPS id 387CD2DC005B; Wed, 26 Jun 2019 20:51:20 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=d-silva.org; s=201810a; t=1561596680; bh=uXs8jdup5M6WacVJmioLChNfDgHR/3okK/USi+R0dJs=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=Tl3RrQYL0XioL8sGGAMZBRqWknudnM9mAtU2K09D59jGWKY1oaqG76hAVZzT4ZFsG CdriFls73SRvMfs8XdqBzB+aEccVYcPFLx1zHLAN2oddkR63Z1Ad/xR9obufNHYcU/ e0BMwHNWSWq/+vuTetXa3ZqNyvoZGML0FvIadxo/SZakXjxnBqk5H8JovNOewoJJKX 0vEznj4A1qeRVXV6uI6YXMZgEwIf2uTFpmM3VszuBa5cVS6DikxekEEtjYrghYFF9p 2beN+y05fYBmu+H9V/jUAMIt2bOC+7NpLGwj5BM1RdPiGZF+S/xkcDYlzltyWoVRqO /MDvJL4Vjfi6uVAdATYbUqSQfeCVZQzj/+yGsLYLo+zCHBG2az4Od5L1qTSTnjeVox Pl/Li2nYdNBA751qpkGfrndceNwtSLFtv6JufV2iGBCD0Q3OBGe4AJO8UsVYcnIvTG KsqpxnBuIQL3dcWTj3nhWPbsHpjZgAygXmqNDAqFMt0ZJNyYjliYYAdwUFcO66T7FK F8IB/CGWrHaCTADGIREZ2Chrq7ht4IrTjW3TO2GYKVt6r8EkShVOuiaynIIrTt4bQm Kj8pEb3VMD9TbUch5JJkfC+yLnGxDOrk73z7LzcmwJhDEoQTZ6gG5WkA3vQBa6Moaw XVOvw/BrkBRL6P7EOVFi4FkY= Received: from adsilva.ozlabs.ibm.com (static-82-10.transact.net.au [122.99.82.10] (may be forged)) (authenticated bits=0) by mail2.nmnhosting.com (8.15.2/8.15.2) with ESMTPSA id x5R0owXw037609 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NO); Thu, 27 Jun 2019 10:51:13 +1000 (AEST) (envelope-from alastair@d-silva.org) Message-ID: Subject: Re: [PATCH v2 1/3] mm: Trigger bug on if a section is not found in __section_nr From: "Alastair D'Silva" To: Michal Hocko Cc: Greg Kroah-Hartman , "Rafael J. Wysocki" , Andrew Morton , Pavel Tatashin , Oscar Salvador , Mike Rapoport , Baoquan He , Wei Yang , Logan Gunthorpe , linux-kernel@vger.kernel.org, linux-mm@kvack.org Date: Thu, 27 Jun 2019 10:50:57 +1000 In-Reply-To: <20190626065751.GK17798@dhcp22.suse.cz> References: <20190626061124.16013-1-alastair@au1.ibm.com> <20190626061124.16013-2-alastair@au1.ibm.com> <20190626062113.GF17798@dhcp22.suse.cz> <20190626065751.GK17798@dhcp22.suse.cz> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.32.2 (3.32.2-1.fc30) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.6.2 (mail2.nmnhosting.com [10.0.1.20]); Thu, 27 Jun 2019 10:51:15 +1000 (AEST) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2019-06-26 at 08:57 +0200, Michal Hocko wrote: > On Wed 26-06-19 16:27:30, Alastair D'Silva wrote: > > On Wed, 2019-06-26 at 08:21 +0200, Michal Hocko wrote: > > > On Wed 26-06-19 16:11:21, Alastair D'Silva wrote: > > > > From: Alastair D'Silva > > > > > > > > If a memory section comes in where the physical address is > > > > greater > > > > than > > > > that which is managed by the kernel, this function would not > > > > trigger the > > > > bug and instead return a bogus section number. > > > > > > > > This patch tracks whether the section was actually found, and > > > > triggers the > > > > bug if not. > > > > > > Why do we want/need that? In other words the changelog should > > > contina > > > WHY and WHAT. This one contains only the later one. > > > > > > > Thanks, I'll update the comment. > > > > During driver development, I tried adding peristent memory at a > > memory > > address that exceeded the maximum permissable address for the > > platform. > > > > This caused __section_nr to silently return bogus section numbers, > > rather than complaining. > > OK, I see, but is an additional code worth it for the non-development > case? I mean why should we be testing for something that shouldn't > happen normally? Is it too easy to get things wrong or what is the > underlying reason to change it now? > It took me a while to identify what the problem was - having the BUG_ON would have saved me a few hours. I'm happy to just have the BUG_ON 'nd drop the new error return (I added that in response to Mike Rapoport's comment that the original patch would still return a bogus section number). -- Alastair D'Silva mob: 0423 762 819 skype: alastair_dsilva Twitter: @EvilDeece blog: http://alastair.d-silva.org