Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1640678yba; Fri, 17 May 2019 02:48:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqyBsIPKipOZ3MXkQQE3BTKLmSHnoeya235eHT9eLYaukV5Y2P9fkbvFG+a++18GZECTsV/O X-Received: by 2002:a17:902:e683:: with SMTP id cn3mr33195283plb.86.1558086502943; Fri, 17 May 2019 02:48:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558086502; cv=none; d=google.com; s=arc-20160816; b=gWa1zQDtZuhepoE/MV1w168/Q/rQ5tWjKUf4WWcOr8x3SU/gW2WsuwA9hMnsXhDTHK KMQUA38h7f0XJcUOik2BtMOjicHWllCbA2G+uHn6TWahKi4/r5t4tvv8nQkaZPmFr3jT EGLeG/f4hdOMs3ES+muopRHCvzgbe9Q1vyKqFqViLjm6+1/5EtwsbV1n8z/4T7UaSqvv qFYfP/S6FSUGCrOvZzs0/zGipdDhmtPHqQaEo2rj59/53i275ALWydrUUc0JrMfHmgsW Xfuhd+quqDgIj/Nas9SmGqlUCFFwI9y/BWBX3SIq3Qp7AhUepYGo9XIyzM+UGbHIaQeP mmpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=T1LN3k7HCvFEEFKH9Lm7as8qY8F4P/ddUVztsv3w/p8=; b=ah39DTTpL6Sn8Qw6wTRFSueZiJZzCF91SUOwxKswzav38qiF2E1MwY2ukKFk+Bfv/r Xe3RASVlt25dGCiGhbD4q+0O7mS9VClALfxCxHpyhkjBZlsV7yp+Tk4fu/y1A6aSV9cf 98QPRf2qTVfbaeA8gzDxV4jim5Xku510flk4wKaioppqUaQh3UCQxqoAEM3MYK7TNoJ0 SITjdza2WJzFu1+kktmnyEf5Txq9xS720MqvWhQC074hFmEfQ5ADwlhop6IvgmmdQbqb AfIJu65zNgHvDE14pgLP9QKbHikOb3lUPpFNKfGmdJURrl9gl6R2/x4S9zODT+EmHMPv WhXQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n63si7614673pgn.511.2019.05.17.02.48.07; Fri, 17 May 2019 02:48:22 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728600AbfEQJdo (ORCPT + 99 others); Fri, 17 May 2019 05:33:44 -0400 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:33524 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727758AbfEQJdo (ORCPT ); Fri, 17 May 2019 05:33:44 -0400 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) id 2A2F380398; Fri, 17 May 2019 11:33:32 +0200 (CEST) Date: Fri, 17 May 2019 11:33:41 +0200 From: Pavel Machek To: Claudiu Manoil Cc: Pavel Machek , Greg Kroah-Hartman , "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" , "David S. Miller" , Sasha Levin , "alexandre.belloni@bootlin.com" Subject: Re: [PATCH 4.19 042/113] ocelot: Dont sleep in atomic context (irqs_disabled()) Message-ID: <20190517093341.GA18565@amd> References: <20190515090652.640988966@linuxfoundation.org> <20190515090656.813206864@linuxfoundation.org> <20190517081642.GC17012@amd> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="J/dobhs11T7y2rNN" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --J/dobhs11T7y2rNN Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! > >On Wed 2019-05-15 12:55:33, Greg Kroah-Hartman wrote: > >> [ Upstream commit a8fd48b50deaa20808bbf0f6685f6f1acba6a64c ] > >> > >> Preemption disabled at: > >> [] dev_set_rx_mode+0x1c/0x38 > >> Call trace: > >> [] dump_backtrace+0x0/0x3d0 > >> [] show_stack+0x14/0x20 > >> [] dump_stack+0xac/0xe4 > >> [] ___might_sleep+0x164/0x238 > >> [] __might_sleep+0x50/0x88 > >> [] kmem_cache_alloc+0x17c/0x1d0 > >> [] ocelot_set_rx_mode+0x108/0x188 > >[mscc_ocelot_common] > >> [] __dev_set_rx_mode+0x58/0xa0 > >> [] dev_set_rx_mode+0x24/0x38 > >> > >> Fixes: a556c76adc05 ("net: mscc: Add initial Ocelot switch support") > > > >Is it right fix? Warning is gone, but now allocation is more likely to > >fail, causing mc_add() to fail under memory pressure. > > >=20 > So far this contributes to fixing a kernel hang issue, seen occasionally > when the switch interfaces were brought up. > Other than that I would look into improving this code. > It looks suboptimal at least. Do we really need to allocate whole > struct netdev_hw_addr elements? Can the allocation size be reduced? > What about pre-allocating enough room for ha elements outside the > atomic context (set_rx_mode() in this case)? Pre-allocating the elements sounds like a obvious solution, yes. Best regards, Pavel --=20 DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany --J/dobhs11T7y2rNN Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlzef/UACgkQMOfwapXb+vJjGgCgstxXfIUGi5SKgeRmDcJmlcjT VUUAn3UEZsjB0dizYH96Q9/AOiF/k8I2 =PdRN -----END PGP SIGNATURE----- --J/dobhs11T7y2rNN--