This message generated a parse failure. Raw output follows here. Please use 'back' to navigate. From devnull@lkml.org Tue May 28 20:05:32 2024 Received: from entropy.muc.muohio.edu (IDENT:root@entropy.muc.muohio.edu [134.53.213.10]) by herbie.ucs.indiana.edu (8.9.3/8.9.3) with ESMTP id BAA26130 for ; Tue, 29 Jun 1999 01:16:05 -0500 (EST) Received: from vger.rutgers.edu (vger.rutgers.edu [128.6.190.2]) by entropy.muc.muohio.edu (8.8.7/8.8.7) with ESMTP id CAA16982; Tue, 29 Jun 1999 02:15:58 -0400 Received: by vger.rutgers.edu via listexpand id ; Tue, 29 Jun 1999 02:14:02 -0400 Received: by vger.rutgers.edu id ; Tue, 29 Jun 1999 02:13:48 -0400 Received: from ns.cartsys.com ([205.217.49.138]:1175 "EHLO Indigo.cartsys.com") by vger.rutgers.edu with ESMTP id ; Tue, 29 Jun 1999 02:13:10 -0400 Received: from unixbox.bitbucket (ppp129.cartsys.com [192.168.111.54]) by Indigo.cartsys.com (Netscape Mail Server v2.02) with ESMTP id AAA28791; Mon, 28 Jun 1999 23:19:37 -0700 Received: from cartsys.com (nate@localhost [127.0.0.1]) by unixbox.bitbucket (8.8.5/8.8.5) with ESMTP id XAA00974; Mon, 28 Jun 1999 23:12:22 -0700 Message-Id: <377863C6.654DCE8C@cartsys.com> Date: Mon, 28 Jun 1999 23:12:22 -0700 From: Nate Eldredge X-Mailer: Mozilla 4.08 [en] (X11; I; Linux 2.2.10 i586) Mime-Version: 1.0 To: tim@cyberelk.demon.co.uk, linux-kernel@vger.rutgers.edu Subject: Re: 2.2.10: weird RSS reported in /proc/*/status Content-Type: multipart/mixed; boundary="------------BB54F3B4A6B6CF916E614991" Sender: owner-linux-kernel@vger.rutgers.edu Precedence: bulk X-Loop: majordomo@vger.rutgers.edu X-Orcpt: rfc822;linux-kernel-outgoing-dig This is a multi-part message in MIME format. --------------BB54F3B4A6B6CF916E614991 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit You wrote: > I noticed this in the output of ps aux: > > USER PID %CPU %MEM SIZE RSS TTY STAT START TIME COMMAND > root 244 56.2 55762.4 4768 -13964 1 R Jun 19 6312:55 dos -ckC > I have seen this too, and also with dosemu. Following is a post I made about it previously. I should like to get this fixed. Perhaps someone will notice this and respond with some thoughts; otherwise, I shall poke into it. TIA for any response... -- Nate Eldredge nate@cartsys.com --------------BB54F3B4A6B6CF916E614991 Content-Type: message/rfc822 Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-ID: <370EDB83.3B5C6B74@cartsys.com> Date: Fri, 09 Apr 1999 22:02:59 -0700 From: Nate Eldredge X-Mailer: Mozilla 4.08 [en] (X11; I; Linux 2.2.5 i586) MIME-Version: 1.0 To: linux-kernel@vger.rutgers.edu Subject: Re: RSS goes negative References: <37069EF5.68041B9@cartsys.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit (Kernel 2.2.5) Nate Eldredge wrote: > > Here's a strange situation. I've been running another app that uses a > lot of swap, and now I notice the RSS for xdos, as reported by > /proc/XX/status, has gone into the negative range. > If there's some more investigating I should do, please let me know by > e-mail ASAP. I can't keep this thing running indefinitely, and I don't > know if it'll be reproducible. It's at least occasionally reproducible. I've seen it a couple more times since posting that. As there has been no response, I'm going to clutter the list a bit by listing my somewhat random guesses as to the cause, in hopes that it will ring a bell with someone. * `zap_page_range' in mm/memory.c contains this somewhat suspicious snippet: if (mm->rss > 0) { mm->rss -= freed; if (mm->rss < 0) mm->rss = 0; } rss is an unsigned long, and presumably the author forgot that (or it changed later). Thus, the tests are meaningless and probably a bug in themselves. But a question: Does their presence mean that rss could legitimately become "negative", and these would correct it when it happens? Or is it a paranoia test to minimize damage in case of the impossible happening? * `do_wp_page' contains: if (PageReserved(mem_map + MAP_NR(old_page))) ++vma->vm_mm->rss; I don't completely understand the Linux mm model, but this seems odd. At this point in the code (handling copy-on-write), a new page has been allocated and is about to be put into the process's memory map. Oughtn't this to increase rss regardless of the attributes of the old page? * The fact that I saw this problem only with dosemu makes me wonder if the bug is in something only it does. `mark_screen_rdonly' in arch/i386/kernel/vm86.c does some fiddling with the process's page tables, and doesn't change rss. As far as I can tell, all it does is take pages that are already present and write-protect them, in which case rss probably shouldn't change. But as I said, I don't completely understand mm, so this could easily be wrong. Lastly, I realize rss is essentially just tourist information, so its correctness isn't (AFAIK) critical. However, negative values are obviously bogus, so IMHO this is a bug. I'd like to see it fixed correctly (i.e. not just a fix-the-symptom `if ((long)rss < 0) rss=0' kind of thing). As I said, I can reproduce this somewhat regularly, and I'm willing to test patches or any other such thing. Thanks for reading; any response is appreciated. -- Nate Eldredge nate@cartsys.com --------------BB54F3B4A6B6CF916E614991-- - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/