Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751926AbeACLZO (ORCPT + 1 other); Wed, 3 Jan 2018 06:25:14 -0500 Received: from mail-he1eur01on0071.outbound.protection.outlook.com ([104.47.0.71]:4407 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751150AbeACLZL (ORCPT ); Wed, 3 Jan 2018 06:25:11 -0500 Subject: Re: [PATCH] ethernet: mlx4: Delete an error message for a failed memory allocation in five functions To: Julia Lawall , Tariq Toukan Cc: SF Markus Elfring , linux-rdma@vger.kernel.org, netdev@vger.kernel.org, LKML , kernel-janitors@vger.kernel.org References: <30191db0-4d99-0349-b66a-c7354ef90d50@users.sourceforge.net> <0fea8f2f-f8fc-ce2e-3d33-44227de3637a@mellanox.com> From: Tariq Toukan Message-ID: Date: Wed, 3 Jan 2018 13:24:59 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [193.47.165.251] X-ClientProxiedBy: AM0PR0102CA0038.eurprd01.prod.exchangelabs.com (2603:10a6:208::15) To DB5PR05MB1141.eurprd05.prod.outlook.com (2a01:111:e400:5812::20) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 33abb6e4-6a62-4e00-a7b9-08d5529ca40b X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(48565401081)(5600026)(4604075)(2017052603307)(7153060);SRVR:DB5PR05MB1141; X-Microsoft-Exchange-Diagnostics: 1;DB5PR05MB1141;3:Io3pSlNS8BBDo+8x68Q87aARYY1SBwLaRwSxOGA4zFMYnreqHBS6zLbCtjRjxJuS/z7maZjdilpIiq+3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22Kv+vH6Onme5NqGKZ5z8clQgX2ej4LRaayI4okpqnyi7M62UcqKQ8H0/0lgffQH90ri0ktduVNBV5Hnaq2lrR7I+bBwocn8VhMx3kKBMIntp2xJa9ktAPbpUDtRXraI56zHv3jfLSVeIP408XVol1mwtD9ZFXuyxO3EUGE+XhZsGYywv7ev+dwYinY0i5T8u6aei4eHqbNiWU4A8N+v3RuJdzJiS+hPAKBBOkr89+fHAnjGQqwfFXdJrTEP7JR/qTX7eyRh7hw2;4:GzqKzbRWUrUrqSTH+B69y8SjSMZzrniFtABOpMiE9g2a/jShMwuum/0kxHKkvgPj5bwvfsIWUPtgSrujCDjti9ualLKyaOsFpkj3xoj1AuvG6/DFW23Wpoapm7mxcUZioZIoVzBkRxVUnfzpynzrWf4s3RH3B6hpn/jYVSoT0/SvBAqqoSW33GxUelglZiWyMgmnki5wMzYjDsldC6AxlSRuM8goL4ltyO6u/TBJjI9gt7UPsLOdJfGy9KDqgQoKe6aPaETJuvXH4qun9iMgpfRwjSA1wR0QQg6kxN4VakOqntLjBdra/9sH9U4/0OZgiu3dlk1SntASw3Tt/lvNKNJ3Q27hWtakSAb4GU0+Tn0= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(9452136761055)(42262312472803); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040470)(2401047)(5005006)(8121501046)(10201501046)(93006095)(93001095)(3231023)(944501075)(3002001)(6055026)(6041268)(20161123558120)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(6072148)(201708071742011);SRVR:DB5PR05MB1141;BCL:0;PCL:0;RULEID:(100000803101)(100110400095);SRVR:DB5PR05MB1141; X-Forefront-PRVS: 0541031FF6 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6049001)(396003)(39860400002)(39380400002)(376002)(346002)(366004)(24454002)(199004)(189003)(105586002)(106356001)(6306002)(86362001)(97736004)(64126003)(229853002)(2420400007)(6486002)(50466002)(15650500001)(77096006)(65806001)(65956001)(66066001)(2486003)(16576012)(58126008)(67846002)(52146003)(316002)(54906003)(23676004)(110136005)(31696002)(68736007)(16526018)(305945005)(83506002)(7736002)(47776003)(52116002)(6666003)(59450400001)(8676002)(5660300001)(4326008)(53546011)(8936002)(2906002)(10710500007)(76176011)(65826007)(230700001)(3846002)(53936002)(6116002)(7110500001)(81156014)(31686004)(478600001)(36756003)(81166006)(6246003)(25786009)(2950100002)(386003)(966005);DIR:OUT;SFP:1101;SCL:1;SRVR:DB5PR05MB1141;H:[10.8.0.245];FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=tariqt@mellanox.com; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtEQjVQUjA1TUIxMTQxOzIzOnJoakRnSUlaVmhTYm5pKytwNFRISFJRSk9y?= =?utf-8?B?Uzk5TVpVUjRrZnlBS2x1YVhvZjFWMmczZHRqVjZYbHpsUzczc1ZsK2J6T0tz?= =?utf-8?B?SmYraDZhamJFNC9BZzRDTWxLUDlKa2x2T2J2TE1TYjlpa2YrR3RPK1A3VGN2?= =?utf-8?B?d0o5Q0oyQkluQWZWdzdOSFZFYXlVcnNjdHZNN2E0ZCtNUTBPYm9vQ1h4Q3Br?= =?utf-8?B?OGhZU1g5eWNUV1V3Q2lpeTIzMlN1azlzNldRYU1sTFQxd3VvQXRDTTBWT2ts?= =?utf-8?B?R3pqV3N0QWVmWFBvNExqcXRBcXZQdEJSUWFheUk2QmdHUEVmMDNFT0tlQ3Zz?= =?utf-8?B?dnJmU2hyOHZYVGtNSEYza0NyZ0xJaDdrcndJS2MxTjE5S08rWjZjYmlaaUd0?= =?utf-8?B?UjNHbkV6OVJPZzJUNXgyeXEyeC9GYituNG80Z1U2MzN6TW9sYmxIMGd1VTN6?= =?utf-8?B?S3lla3NJWDM3V2J2NEUwZDdIRlhmWDhxemwyRUM2R1NLMDg1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oUJAUhNcuymhAj6zSff1llDJen4rAaWwE2S3TRRIiqFLRPIcs1l1eEagxEboO0RG6N7I6rgvgbfGQBuM1cu+xTUry7L1uRGIkUUycjWoCmdZBdGV5xq/TBtyf/FLuwYCQk35ynRJ7vH+r+GL9oaqQYvoYTsMjkHd0QYQ7oEE5ZpnR9LbY3kZNMJUFpnQXVgxu5xJNGs1LvknU=;5:YHxmx7QvPXETGuLyz4bACdCufsLjW8Lc9zijvCU7G7+llqZE2qcMaRQDRbmCwl2GYPmiqqVr2hc4ScY6k8YhxNz7xnU80k0e70qXgoSxk0nnjvPcWIjw9iA4zWzASWLwPchn8gpznJkc32VhCjVN7CNsGYx576c8G3863Yyi8MA=;24:LgSkq/0iVWzd79OwhS6fO35mDvtGHrtYIRvKCCtpGOyCB5KbVBYv/6qRrjFNikmKH427tx8mLarqHLK94t4v2YkrGeOBI6n+mtqLgwqsqlk=;7:XAngWlRVTGHVdR1CkxXYseA4dCKvkSZOZ2KCpVjhEo850O9b8GyiEEQT6PTxgDHOavs0BzVK4/sSEr/2xQMaPXsornMQN5BiNdm3oYeFPYUM9NtIOW7M8pa65FvIvrux9MXGSsnHIAfcLsSpK6T/7rDwpSCBQMard+e9JY6ExOw70uccu4++kICr7jRCdOhqWqDp4HuUUG69/YoCui91vENKNDeVPggWMSxCeEgEZfzqIeH741vFs0XmbVcqxnlm SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jan 2018 11:25:04.9802 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 33abb6e4-6a62-4e00-a7b9-08d5529ca40b X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB5PR05MB1141 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On 03/01/2018 10:06 AM, Julia Lawall wrote: > > > On Wed, 3 Jan 2018, Tariq Toukan wrote: > >> >> >> On 01/01/2018 10:46 PM, SF Markus Elfring wrote: >>> From: Markus Elfring >>> Date: Mon, 1 Jan 2018 21:42:27 +0100 >>> >>> Omit an extra message for a memory allocation failure in these functions. >>> >>> This issue was detected by using the Coccinelle software. >>> >>> Signed-off-by: Markus Elfring >>> --- >> >> Is this an issue? Why? What is your motivation? >> These are error messages, very informative, appear only upon errors, and in >> control flow. > > Strings take up space. Since there is a backtrace on an out of memory > problem, if the string does not provide any more information than the > position of the call, then there is not much added value. I don't know > what was the string in this case. If it provides some additional > information, then it would be reasonable to keep it. I don't really accept this claim... Short informative strings worth the tiny space they consume. It helps the users of our driver understand what went wrong in simple words, without the need to understand the role of the functions/callstack or being familiar with different parts of the driver code. In addition, some out-of-memory errors are recoverable, even though their backtrace is also printed. For example, in function mlx4_en_create_cq (appears in patch) we have a first allocation attempt (kzalloc_node) and a fallback (kzalloc). I'd prefer to state a clear error message only when both have failed, because otherwise the user might be confused whether the backtrace should indicate a malfunctioning interface, or not. Tariq > > julia > >> -- >> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in >> the body of a message to majordomo@vger.kernel.org >> More majordomo info at http://vger.kernel.org/majordomo-info.html >>