Skip to contentSkip to conversation

9/10 intermezzos prefer eating memory

PATCH Anton Blanchard 7 participants 8 messages May 2, 2004 – May 14, 2004 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

Hi,

Im sure the 4kB stack brigade wont be too happy about this:

presto_get_fileid: 4672
presto_copy_kml_tail: 4272

This is 2.6. The following patch fixes it. There are still more things to attack (this is on ppc64 but you get the idea):

presto_ioctl: 1424
presto_journal_unlink: 1056
presto_journal_rename: 1040
presto_journal_rmdir: 1008

Anton

--

fs/intermezzo/journal.c renamed from fs/intermezzo/journal.c~intermezzofix +24 -5
diff -puN fs/intermezzo/journal.c~intermezzofix fs/intermezzo/journal.c
@@ -1235,12 +1235,15 @@ int presto_write_kml_logical_offset(stru
         return izo_rcvd_write(fset, &rec);
 }
 
+#define BUFSIZE 4096
+
 struct file * presto_copy_kml_tail(struct presto_file_set *fset,
                                    unsigned long int start)
 {
         struct file *f;
         int len;
         loff_t read_off, write_off, bytes;
+        char *buf;
 
         ENTRY;
 
@@ -1251,15 +1254,21 @@ struct file * presto_copy_kml_tail(struc
                 return f;
         }
 
+        buf = kmalloc(BUFSIZE, GFP_KERNEL);
+        if (!buf) {
+                EXIT;
+                return -ENOMEM;
+        }
+        memset(buf, 0, BUFSIZE);
+
         write_off = 0;
         read_off = start;
         bytes = fset->fset_kml.fd_offset - start;
         while (bytes > 0) {
-                char buf[4096];
                 int toread;
 
-                if (bytes > sizeof(buf))
-                        toread = sizeof(buf);
+                if (bytes > BUFSIZE)
+                        toread = BUFSIZE;
                 else
                         toread = bytes;
 
@@ -1270,6 +1279,7 @@ struct file * presto_copy_kml_tail(struc
 
                 if (presto_fwrite(f, buf, len, &write_off) != len) {
                         filp_close(f, NULL);
+                        kfree(buf);
                         EXIT;
                         return ERR_PTR(-EIO);
                 }
@@ -1277,6 +1287,7 @@ struct file * presto_copy_kml_tail(struc
                 bytes -= len;
         }
 
+        kfree(buf);
         EXIT;
         return f;
 }
@@ -1580,12 +1591,14 @@ int presto_journal_setattr(struct rec_in
         return error;
 }
 
+#define RECORD_LENGTH 4096
+
 int presto_get_fileid(int minor, struct presto_file_set *fset,
                       struct dentry *dentry)
 {
         int opcode = KML_OPCODE_GET_FILEID;
         struct rec_info rec;
-        char *buffer, *path, *logrecord, record[4096]; /*include path*/
+        char *buffer, *path, *logrecord, *record; /*include path*/
         struct dentry *root;
         __u32 uid, gid, pathlen;
         int error, size;
@@ -1593,6 +1606,11 @@ int presto_get_fileid(int minor, struct 
 
         ENTRY;
 
+        record = kmalloc(RECORD_LENGTH, GFP_KERNEL);
+        if (!record)
+                return -ENOMEM;
+        memset(record, 0, RECORD_LENGTH);
+
         root = fset->fset_dentry;
 
         uid = cpu_to_le32(dentry->d_inode->i_uid);
@@ -1606,7 +1624,7 @@ int presto_get_fileid(int minor, struct 
                 sizeof(struct kml_suffix);
 
         CDEBUG(D_FILE, "kml size: %d\n", size);
-        if ( size > sizeof(record) )
+        if ( size > RECORD_LENGTH )
                 CERROR("InterMezzo: BUFFER OVERFLOW in %s!\n", __FUNCTION__);
 
         memset(&rec, 0, sizeof(rec));
@@ -1628,6 +1646,7 @@ int presto_get_fileid(int minor, struct 
                                    size_round(le32_to_cpu(pathlen)), path,
                                    fset->fset_name);
 
+        kfree(record);
         BUFF_FREE(buffer);
         EXIT;
         return error;
#1 lore raw
Quoted 3 lines · Anton Blanchard

Hi,

Im sure the 4kB stack brigade wont be too happy about this:

I thought intermezzo would have been rm -rf'd by now...

#2 lore raw
Quoted 6 lines · Arjan van de Ven
Quoted 3 lines · Anton Blanchard

Hi,

Im sure the 4kB stack brigade wont be too happy about this:

I thought intermezzo would have been rm -rf'd by now...

Should have. I've written patches for intermezzo a year ago. Maintenance is a little slow these days. :)

Jörn

Signature · 2 lines
It does not matter how slowly you go, so long as you do not stop.
-- Confucius
#3 lore raw
Quoted 10 lines · Jörn Engel
Quoted 6 lines · Arjan van de Ven
Quoted 3 lines · Anton Blanchard

Hi,

Im sure the 4kB stack brigade wont be too happy about this:

I thought intermezzo would have been rm -rf'd by now...

Should have. I've written patches for intermezzo a year ago. Maintenance is a little slow these days. :)

Likewise. I have a patch[0] for intermezzo stack lossage from 2.5.73 era that hasn't been applied yet, AFAIK.

[0] http://www.mulix.org/patches/intermezzo-stack-lossage-2.5.73.diff

Cheers,
Muli

Signature · 2 lines
Muli Ben-Yehuda
http://www.mulix.org | http://mulix.livejournal.com/
#4 lore raw
In reply to Arjan van de Ven

Hi Andrew,

I would just like to say that I have no difficulties with intermezzo being rm -rf'd. There are probably only a handful of users.

In the past 4 years nobody has supported InterMezzo sufficiently for it to become successful. I have been fortunate to get really good support for the Lustre project. So I have focussed on that. Lustre 1.X has become really solid.

The disconnected operation, caching and mirroring functionality of InterMezzo will become available in Lustre as a new feature in version 2.

So I see no point in keeping InterMezzo if it is a nuisance.

I am also entirely happy to ask my one part time InterMezzo programmer to do a better job of repeatedly sending pathes until they are in.

Please guide me along. Thanks!

- Peter -

Quoted 17 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Arjan van de Ven
Sent: Sunday, May 02, 2004 4:22 PM
To: Anton Blanchard
Cc: [email protected]; [email protected]; [email protected]
Subject: Re: 9/10 intermezzos prefer eating memory

Quoted 3 lines · Anton Blanchard

Hi,

Im sure the 4kB stack brigade wont be too happy about this:

I thought intermezzo would have been rm -rf'd by now...

#5 lore raw
Quoted 15 lines · Peter J. Braam

Hi Andrew,

I would just like to say that I have no difficulties with intermezzo being rm -rf'd. There are probably only a handful of users.

In the past 4 years nobody has supported InterMezzo sufficiently for it to become successful. I have been fortunate to get really good support for the Lustre project. So I have focussed on that. Lustre 1.X has become really solid.

The disconnected operation, caching and mirroring functionality of InterMezzo will become available in Lustre as a new feature in version 2.

Quoted 7 lines

So I see no point in keeping InterMezzo if it is a nuisance.

I am also entirely happy to ask my one part time InterMezzo programmer to do a better job of repeatedly sending pathes until they are in.

Please guide me along. Thanks!

Thanks - such opportunities are all too rare.

Are there any distro people out there who have a significant Intermezzo user base, or who see any problems with this?

#6 lore raw
Quoted 21 lines · Andrew Morton
Quoted 20 lines · Peter J. Braam

Hi Andrew,

I would just like to say that I have no difficulties with intermezzo being rm -rf'd. There are probably only a handful of users.

In the past 4 years nobody has supported InterMezzo sufficiently for it to become successful. I have been fortunate to get really good support for the Lustre project. So I have focussed on that. Lustre 1.X has become really solid.

The disconnected operation, caching and mirroring functionality of InterMezzo will become available in Lustre as a new feature in version 2.

So I see no point in keeping InterMezzo if it is a nuisance.

I am also entirely happy to ask my one part time InterMezzo programmer to do a better job of repeatedly sending pathes until they are in.

Quoted 7 lines
Quoted 2 lines

Please guide me along. Thanks!

Thanks - such opportunities are all too rare.

Are there any distro people out there who have a significant Intermezzo user base, or who see any problems with this?

As one of the apparently 3 or 4 longtime users of Intermezzo, I like the architecture, but the user-level utilities for manageing it (aka, for resolving conflicts that occured during disconnected operation) just aren't there, and nobody (including myself) has really had time to devote to getting them in working shape.

I'd love to get my hands on Lustre version 2 and start beating up the disconnected operation. If that's available in CVS somewhere, I'd vote for rm -rf of intermezzo.

--------------------------------------------------------------------------
Troy Benjegerdes 'da hozer' [email protected]

Somone asked my why I work on this free (http://www.fsf.org/philosophy/)
software stuff and not get a real job. Charles Shultz had the best answer:

"Why do musicians compose symphonies and poets write poems? They do it because life wouldn't have any meaning for them if they didn't. That's why I draw cartoons. It's my life." -- Charles Shultz

A message that is not in the archive (sent off-list or not yet received): [email protected]

#8 lore raw
Quoted 11 lines · Daniel Egger
Quoted 3 lines · Peter J. Braam

I would just like to say that I have no difficulties with intermezzo being
rm -rf'd. There are probably only a handful of users.

After my painful experience that it never worked cross-architecture[1] I decided to stay completely away from it. I would not consider a filesystem that doesn't work at all on some popular platforms to be "stable" and thus 2.4 or 2.6 worthy.

Quoted 4 lines

[1] powerpc-linux client, x86-linux server

Servus,
Daniel

That's kinda weird.. I'm running a powerpc-linux server, x86-client

All my MP3's are on an intermezzo filesystem.