Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp823343ybh; Wed, 18 Mar 2020 09:45:34 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtpgusxM3AiI/MKnrWGaNO8PDjRLOFQjcBLgvfCpWdk5XyBvAVNql6auu8X0evQz3ErOzyq X-Received: by 2002:a9d:2215:: with SMTP id o21mr4457849ota.113.1584549934169; Wed, 18 Mar 2020 09:45:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584549934; cv=none; d=google.com; s=arc-20160816; b=bslpMIU/WyMvKoAUGbH2jCd5p9aHI1kz/kiU0ydTRJcTnOstcT6Loy250P517R35vG 83mU8rbyJUOOiVILbEtfTY+wkjTOtRL1TJSJ5xrNlQfMZqMYa9XRDhi8+xs+COHkLZvR 3koQZuH+ITEYxUOHcTMFDNZ538NX5ShdYB3qallV627Zr+0bDeqQKdjnhdkiZRbIw42K xApvAWDdwK5UugyG0GjHkPFOWFBN21vVYCBaBlU8ifFbIIcKFYCWFolKKNxZ7HNoknhA a0u1tRffcwupiLxGkBJutjldp8su6C4ydZPPwcMILEghS4tbKefSCen4jSjqUEveiLCY hVcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:references:in-reply-to:date :subject:cc:to:from; bh=56Pl9hFP3J2FTagWsug/+V2TrTxAVJVjU1LuVfio9Hg=; b=MM1ejqxCgCUXh+pBj7eeP7rRvE+BLPFMm8ubSeAO7+L5P2tf21k93QmE7FslBA2REf xoEG+cTXqJTPXD7kw+CRNrQFksCU9a7ouwIVVRd6v/bGVlEyzRxOQZtJUv7qOWnuXor/ jube8vpezxl+tIrc5awI5uIPnsU97mxZSAw2Zmvzn5f/bIhStxuYXpgKxr71IoIe85Fi a9BSyncyuuJeBRlEGNlFnop2X73aHp0Fl1kVG2LmFRehuq+ZmRu3t81JMMT7KIWNbmWC J/LdlWac23eb6RryZxIOgiSGuBJCf4RNpbIqpatz40jNvUFopvDp4ltryH1fBSXXXfeV sqcg== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r17si3683831ota.160.2020.03.18.09.45.19; Wed, 18 Mar 2020 09:45:34 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727099AbgCRQok (ORCPT + 99 others); Wed, 18 Mar 2020 12:44:40 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:22926 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726954AbgCRQoj (ORCPT ); Wed, 18 Mar 2020 12:44:39 -0400 Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 02IGdkPo112185 for ; Wed, 18 Mar 2020 12:44:38 -0400 Received: from e06smtp04.uk.ibm.com (e06smtp04.uk.ibm.com [195.75.94.100]) by mx0a-001b2d01.pphosted.com with ESMTP id 2yupjt1tc0-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 18 Mar 2020 12:44:38 -0400 Received: from localhost by e06smtp04.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 18 Mar 2020 16:44:36 -0000 Received: from b06avi18878370.portsmouth.uk.ibm.com (9.149.26.194) by e06smtp04.uk.ibm.com (192.168.101.134) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Wed, 18 Mar 2020 16:44:32 -0000 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06avi18878370.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 02IGiVSv28246434 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 18 Mar 2020 16:44:32 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DC9B05204E; Wed, 18 Mar 2020 16:44:31 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.152.85.9]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTP id A2BAF5204F; Wed, 18 Mar 2020 16:44:31 +0000 (GMT) From: Niklas Schnelle To: linux-kernel@vger.kernel.org Cc: Saeed Mahameed , Leon Romanovsky , Eran Ben Elisha , Moshe Shemesh , Niklas Schnelle Subject: [RFC 1/1] net/mlx5: Fix failing fw tracer allocation on s390 Date: Wed, 18 Mar 2020 17:44:31 +0100 X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200318164431.85948-1-schnelle@linux.ibm.com> References: <20200318164431.85948-1-schnelle@linux.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 20031816-0016-0000-0000-000002F34EDE X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 20031816-0017-0000-0000-00003356D4D2 Message-Id: <20200318164431.85948-2-schnelle@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138,18.0.645 definitions=2020-03-18_07:2020-03-18,2020-03-18 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=3 bulkscore=0 impostorscore=0 phishscore=0 clxscore=1015 malwarescore=0 adultscore=0 mlxlogscore=999 lowpriorityscore=0 spamscore=0 priorityscore=1501 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2003180075 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On s390 FORCE_MAX_ZONEORDER is 9 instead of 11, thus a larger kzalloc() allocation as done for the firmware tracer will always fail. Looking at mlx5_fw_tracer_save_trace(), it is actually the driver itself that copies the debug data into the trace array and there is no need for the allocation to be contiguous in physical memory. We can therefor use kvzalloc() instead of kzalloc() and get rid of the large contiguous allcoation. Signed-off-by: Niklas Schnelle --- drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c b/drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c index 94d7b69a95c7..eb2e57ff08a6 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c @@ -935,7 +935,7 @@ struct mlx5_fw_tracer *mlx5_fw_tracer_create(struct mlx5_core_dev *dev) return NULL; } - tracer = kzalloc(sizeof(*tracer), GFP_KERNEL); + tracer = kvzalloc(sizeof(*tracer), GFP_KERNEL); if (!tracer) return ERR_PTR(-ENOMEM); @@ -982,7 +982,7 @@ struct mlx5_fw_tracer *mlx5_fw_tracer_create(struct mlx5_core_dev *dev) tracer->dev = NULL; destroy_workqueue(tracer->work_queue); free_tracer: - kfree(tracer); + kvfree(tracer); return ERR_PTR(err); } @@ -1061,7 +1061,7 @@ void mlx5_fw_tracer_destroy(struct mlx5_fw_tracer *tracer) mlx5_fw_tracer_destroy_log_buf(tracer); flush_workqueue(tracer->work_queue); destroy_workqueue(tracer->work_queue); - kfree(tracer); + kvfree(tracer); } static int fw_tracer_event(struct notifier_block *nb, unsigned long action, void *data) -- 2.17.1