From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4380 invoked by alias); 7 Oct 2003 10:57:03 -0000 Mailing-List: contact ecos-discuss-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@sources.redhat.com Received: (qmail 4373 invoked from network); 7 Oct 2003 10:57:03 -0000 Received: from unknown (HELO mail.broadpark.no) (217.13.4.2) by sources.redhat.com with SMTP; 7 Oct 2003 10:57:03 -0000 Received: from famine (217-13-20-38.dd.nextgentel.com [217.13.20.38]) by mail.broadpark.no (Postfix) with ESMTP id 299B27A455 for ; Tue, 7 Oct 2003 12:57:01 +0200 (MEST) From: =?ISO-8859-1?Q?=D8yvind?= Harboe To: ecos-discuss@sources.redhat.com Content-Type: text/plain Organization: Zylin AS Message-Id: <1065524219.5485.43.camel@famine> Mime-Version: 1.0 Date: Tue, 07 Oct 2003 10:57:00 -0000 Content-Transfer-Encoding: 7bit Subject: [ECOS] Stress testing JFFS2 X-SW-Source: 2003-10/txt/msg00092.txt.bz2 Today stress testing JFFS2 came up on the agenda, and I wrote a small piece that demonstrates a problem with JFFS2 running out of space when it shouldn't, leaving a corrupt JFFS2 image and continuously allocating more ram. The test consists of writing lots of files that overwrite existing files. The total number of files is never >16. /config is a JFFS2 fs. 6*0x10000bytes. Should I expect this sort of thing to never fail and to reach a plateau of memory usage? 20-30k ram seems excessive for 16 files. char *args="dummy"; for (int i=0; i<10000; i++) { char name[5]; for (int j=0; j<(sizeof(name)-1); j++) { name[j]=rand()%2+'a'; }; name[4]=0; char nameBuffer[100]; sprintf(nameBuffer, "/config/%s", name); int fd; fd = open( nameBuffer, O_WRONLY|O_CREAT|O_TRUNC ); if (fd<0) { diag_printf("Failed\r\n"); break; } int len=strlen(args); ssize_t actual; actual=write(fd, args, len); if (actual<0) { diag_printf("Failed\r\n"); break; } int err; err=close(fd); if (err<0) { diag_printf("Failed\r\n"); break; } struct mallinfo info; info = mallinfo(); if ((i%100)==0) { diag_printf("Created file %d %d bytes ram free\r\n", i, info.maxfree); } } Output: Created file 0 153284 bytes ram free Created file 100 149132 bytes ram free Created file 200 146732 bytes ram free Created file 300 144332 bytes ram free Created file 400 141932 bytes ram free Created file 500 139532 bytes ram free Created file 600 137132 bytes ram free Created file 700 134732 bytes ram free Created file 800 132332 bytes ram free Failed -- Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos and search the list archive: http://sources.redhat.com/ml/ecos-discuss