Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp84613pxa; Fri, 21 Aug 2020 01:40:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw18B64lOgDz/TIZV1kAlb5kPhwTBQEmkyKbVtnvjY7lk+bgm/YFakFh8YapgAwQ/pX0hui X-Received: by 2002:a17:906:4157:: with SMTP id l23mr1671099ejk.491.1597999251880; Fri, 21 Aug 2020 01:40:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597999251; cv=none; d=google.com; s=arc-20160816; b=hMjdwTAM9KOUNkFvGYTj+0HqjvyS9kMXCHJdTBWMJbDZnSkfbbxcqoZ5EnMtjX4lSI S0yhbvJk0AQjgL3B23o53/O7w+ZD8IC8og/SXlUzVohKgcWp/Vfo+gdn3CKbezSJdWwE eKWzVz0EVcoGHYQ7BrE4Nm055euan9iA+64z9yRPYrW8s4/Y1GBUHbWoIBVqNG3GVgMK p2Ofg8mzMwzN6wlXgbdI+89CrLkY3bjHymG9mfa8scL0StouNv0gM4qIcpe9ux68Ho81 13NboyPuwFD9sE6jDqXBJF1UB9rEWWXG26L4QGH8545fMEUqJ+iU8ri6laKGtrv4o4rt fOFw== 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 :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from; bh=LuEosg7VxW71bagd3CUhrJiVhROa+womldTEt5W6lsY=; b=LiWcBNd0ACIzfs8L6NTIXhIa2QSnZEVcNBphJ+NHuofHedylR3y9K8b03p1Nqy8bGf Zjhu+mTIIkOMo/HI/PEhVwdfZbDfq/bbFqc3hhRF8XPvu//zQ1aPctFSMKPf07YRq8wA IddX9HxCcpKaVx4RzooMGWURmDAZbI1Il2yHObdoID8cWtAdyLMhgI/TulakaP5A2EwA eUf7xcY0ah8F5L6V4mqbqWYhUpHw5Xv6B9BKOrUx0ksjMEW4XElM7Vqn0y1T8nJlhmHQ qEy3sKwsU+CMYIUu9KMH1rCoGT2UGwJIB6FFaMHt+0zjOslqLF/mxt8tQlmtXXXYhMEz 9kLA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l18si752945edq.425.2020.08.21.01.40.28; Fri, 21 Aug 2020 01:40:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727906AbgHUIjv convert rfc822-to-8bit (ORCPT + 99 others); Fri, 21 Aug 2020 04:39:51 -0400 Received: from eu-smtp-delivery-151.mimecast.com ([185.58.86.151]:37690 "EHLO eu-smtp-delivery-151.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726433AbgHUIjv (ORCPT ); Fri, 21 Aug 2020 04:39:51 -0400 Received: from AcuMS.aculab.com (156.67.243.126 [156.67.243.126]) (Using TLS) by relay.mimecast.com with ESMTP id uk-mta-267-_gpouvAZPXW8jiqY6_gXxA-1; Fri, 21 Aug 2020 09:39:46 +0100 X-MC-Unique: _gpouvAZPXW8jiqY6_gXxA-1 Received: from AcuMS.Aculab.com (fd9f:af1c:a25b:0:43c:695e:880f:8750) by AcuMS.aculab.com (fd9f:af1c:a25b:0:43c:695e:880f:8750) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Fri, 21 Aug 2020 09:39:45 +0100 Received: from AcuMS.Aculab.com ([fe80::43c:695e:880f:8750]) by AcuMS.aculab.com ([fe80::43c:695e:880f:8750%12]) with mapi id 15.00.1347.000; Fri, 21 Aug 2020 09:39:45 +0100 From: David Laight To: 'Yue Hu' , "rui.zhang@intel.com" , "daniel.lezcano@linaro.org" , "amit.kucheria@verdurent.com" , "viresh.kumar@linaro.org" CC: "linux-pm@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "huyue2@yulong.com" , "zhangwen@yulong.com" Subject: RE: [PATCH] thermal: sysfs: Fall back to vmalloc() for cooling device's statistics Thread-Topic: [PATCH] thermal: sysfs: Fall back to vmalloc() for cooling device's statistics Thread-Index: AQHWd2T1s2XRZ72P6kCMdg6RVGFevalCPhSw Date: Fri, 21 Aug 2020 08:39:45 +0000 Message-ID: <7a0c2e488e024c0694fd730f95ba98fb@AcuMS.aculab.com> References: <20200821024406.10404-1-zbestahu@gmail.com> In-Reply-To: <20200821024406.10404-1-zbestahu@gmail.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=C51A453 smtp.mailfrom=david.laight@aculab.com X-Mimecast-Spam-Score: 0.002 X-Mimecast-Originator: aculab.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yue Hu > Sent: 21 August 2020 03:44 > > From: Yue Hu > > We observed warning about kzalloc() when register thermal cooling device > in backlight_device_register(). backlight display can be a cooling device > since reducing screen brightness will can help reduce temperature. > > However, ->get_max_state of backlight will assign max brightness of 1024 > to states. The memory size can be getting 1MB+ due to states * states. > That is so large to trigger kmalloc() warning. I can't help feeling that there is an 'adequate' implementation that doesn't require anywhere near 1MB of memory. David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)