Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754456Ab0DSMUh (ORCPT ); Mon, 19 Apr 2010 08:20:37 -0400 Received: from mail-bw0-f225.google.com ([209.85.218.225]:41761 "EHLO mail-bw0-f225.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754331Ab0DSMUg (ORCPT ); Mon, 19 Apr 2010 08:20:36 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:cc:content-type; b=gZkp9dU0DdGxuEPMs6id746zr2MG3mgvhPdI2sy2YksbUjtxotwxGj3ScDRHaG1Iw1 2OOHlobKhSAhKuuanvGEUmmCqUk7v3RdZgINeoy5+WCqAoGbHm1zlFLbut9d5Rfo0W5j +QwK2X2UuTprOVMP/TqHZRcdUbR1KZFYqbW+s= MIME-Version: 1.0 Date: Mon, 19 Apr 2010 15:20:34 +0300 Message-ID: Subject: request_firmware API exhaust memory From: Tomas Winkler To: Johannes Berg , Kay Sievers , Greg KH , David Woodhouse , "Rafael J. Wysocki" , Emmanuel Grumbach Cc: linux-kernel@vger.kernel.org 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-Length: 4870 Lines: 68 Lately we've been developing a device that rather more extensively used request_firmware API in load and also using pm_notifiers to load firmware. In some stress testing the usage will exhaust the system memory. First we suspected there is a memory leak in the firwmare_class but eventually what is that udevd piles up it takes time to collect the process. We loose ~ 500K for each request/release_firmware iteration. After the stress the process table will will look something like shown below, If someone with more insight can point out what part of this firmware load has to be fixed and what is the best strategy request_firmware API used extensively. I believe currently only Orinoco driver uses pm_notifies to load firmware before S3/S4 but if there are more drivers like that it might actually create a real problem during suspend on some small systems. root 514 0.0 0.0 15480 1116 ? S