Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752046AbdF3SD4 (ORCPT ); Fri, 30 Jun 2017 14:03:56 -0400 Received: from canardo.mork.no ([148.122.252.1]:48313 "EHLO canardo.mork.no" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751189AbdF3SDy (ORCPT ); Fri, 30 Jun 2017 14:03:54 -0400 From: =?utf-8?Q?Bj=C3=B8rn_Mork?= To: "Baxter\, Jim" Cc: , , , Oliver Neukum , David Laight Subject: Re: [PATCH V2 1/1] net: cdc_ncm: Reduce memory use when kernel memory low Organization: m References: <1498682129-9129-1-git-send-email-jim_baxter@mentor.com> <1498682129-9129-2-git-send-email-jim_baxter@mentor.com> <87bmp5s7dx.fsf@miraculix.mork.no> <356bdf94-813d-94ef-4dc3-a582fe5b3343@mentor.com> Date: Fri, 30 Jun 2017 20:03:40 +0200 In-Reply-To: <356bdf94-813d-94ef-4dc3-a582fe5b3343@mentor.com> (Jim Baxter's message of "Fri, 30 Jun 2017 18:53:56 +0100") Message-ID: <8760fds683.fsf@miraculix.mork.no> User-Agent: Gnus/5.130015 (Ma Gnus v0.15) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 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 quoted-printable to 8bit by mail.home.local id v5UI4uOZ030849 Content-Length: 835 Lines: 22 "Baxter, Jim" writes: > I tested this with printk's to show when the low memory code was triggered > and the value of ctx->tx_low_mem_val and ctx->tx_low_mem_max_cnt. > I created a workqueue that slowly used up the atomic memory until the > code is triggered. > > I could add debug prints, though I have noticed that cdc_ncm_fill_tx_frame() > does not currently have any debug prints do you think this is because it can be > called in an atomic context and I think debug messages if enabled could cause > too great a delay? Yes, I guess you're right. Maybe count the number of failed allocations and export it along with the other driver private counters? Or export the tx_curr_size as a sysfs attribute? Or both? Just an idea... I don't expect to see this code ever being hit on my systems :-) Bjørn