From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933300AbcLPVeW (ORCPT ); Fri, 16 Dec 2016 16:34:22 -0500 Received: from mail-bn3nam01on0105.outbound.protection.outlook.com ([104.47.33.105]:2754 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932940AbcLPVeR (ORCPT ); Fri, 16 Dec 2016 16:34:17 -0500 From: Matthew Wilcox To: Heiko Stuebner , Andrew Morton , Matthew Wilcox , Zhang Rui , Eduardo Valentin CC: "linux-kernel@vger.kernel.org" Subject: RE: thermal zones break with patch "Reimplement IDR and IDA using the radix tree" (mainline+next) Thread-Topic: thermal zones break with patch "Reimplement IDR and IDA using the radix tree" (mainline+next) Thread-Index: AQHSV+EusKhq+NTzpU2L+9hvpr85sqELExFQ Date: Fri, 16 Dec 2016 21:19:37 +0000 Message-ID: References: <1758112.VgMJOyEgSu@phil> In-Reply-To: <1758112.VgMJOyEgSu@phil> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=mawilcox@microsoft.com; x-originating-ip: [104.247.244.59] x-ms-office365-filtering-correlation-id: 879a2968-f08d-47ea-64b5-08d425f93ddc x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:BY2PR21MB0035; x-microsoft-exchange-diagnostics: 1;BY2PR21MB0035;7:2TphXWfVKskjsbjj8AjGj5oT69XCCMLJBZpbAF9rw5CkZW2mAq/3sJMrWXhrBVBGfVdqT3LxOV6DTP3RgIinqtM7nxgXqtF8icK4bVGoXQUKjvkVbVj3fjsrSq1ojOEXsWI2dk35dHmafv9jmwefyMIqRYj2/0PZtu5YB5fqtvo/uyzvbqhLwAHObJyBk3vwfihaKXLI36R6eMf2wX8dFSqAl/OaJ3AFi6JtfqxaH9o9yzkatYtjW3ZshqXJYZ/FXnW8Z01F1GZT9TLloGa+8hNv6YEREGjBB0lZQ9tW2IFcGe/y3fswiYUjbKzJC6JQLV4RmZMKwQG4P38HJq1D7NFgg6pFBQ0IjdMxUkHWT7lXcbhUJODF9OMHQr7itiK0fWqV6DiHCV3qi1CEn2RWGJ7f4UxJKK0wMyPIFbnooKMgrN3CAfGbhEY30S8gI4ZxaWdOBvFRXQCZ+gjhRxzjivl+pY5QM1Jyl2svmjuHmY8= x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(61425038)(6040375)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6055026)(61426038)(61427038)(6041248)(20161123560025)(20161123564025)(20161123558021)(20161123562025)(20161123555025)(6072148);SRVR:BY2PR21MB0035;BCL:0;PCL:0;RULEID:;SRVR:BY2PR21MB0035; x-forefront-prvs: 01583E185C x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(7916002)(39410400002)(39450400003)(39860400002)(39840400002)(39850400002)(199003)(51914003)(189002)(3660700001)(3846002)(575784001)(86362001)(6116002)(8990500004)(3280700002)(86612001)(122556002)(5005710100001)(10290500002)(7696004)(68736007)(4326007)(76176999)(66066001)(5660300001)(9686002)(25786008)(8936002)(102836003)(8676002)(50986999)(54356999)(81166006)(6436002)(2906002)(81156014)(101416001)(2950100002)(10090500001)(6506006)(74316002)(33656002)(7736002)(92566002)(5001770100001)(38730400001)(97736004)(77096006)(39060400001)(76576001)(106356001)(229853002)(106116001)(189998001)(99286002)(105586002)(305945005)(2900100001);DIR:OUT;SFP:1102;SCL:1;SRVR:BY2PR21MB0035;H:BY2PR21MB0036.namprd21.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Dec 2016 21:19:37.8568 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR21MB0035 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id uBGLYPf3001017 From: Heiko Stuebner [mailto:heiko@sntech.de] > commit b05bbe3ea2db ("Reimplement IDR and IDA using the radix tree") > seems to > break thermal zone allocation. This happens both on todays mainline and > linux-next-20161216 and produces errors like: > While I haven't looked to deeply into what idr exactly does, some findings: > - thermal_zone0 and thermal_zone1 are allocated correctly > - every further thermal_zone always gets allocated the number "1" > - thermal core calls idr_alloc with 0 for both start and end > - the rewrite-patch seems to change the semantics of idr_alloc > where it orignally said "@end: the maximum id (exclusive, <= 0 for max)" > the "<= 0" part is gone now, but I checked, simply setting INT_MAX > as end in the thermal_core does not help Hi Heiko, Thanks for the report! The problem is because the thermal subsystem calls idr_alloc() passing a NULL pointer for the data. I have fixed this problem in my git tree but haven't sent the patch to Andrew yet. This patch should fix the problem for you: http://git.infradead.org/users/willy/linux-dax.git/commitdiff/c52eeed7b759c3fefe9b7f1b0a17a438df6950f3 Now ... thermal is actually using an IDR when it could save memory by using an IDA. Are you interested in doing that conversion?