Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753145AbYKQOCt (ORCPT ); Mon, 17 Nov 2008 09:02:49 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751692AbYKQOCl (ORCPT ); Mon, 17 Nov 2008 09:02:41 -0500 Received: from extu-mxob-2.symantec.com ([216.10.194.135]:37940 "EHLO extu-mxob-2.symantec.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751845AbYKQOCk (ORCPT ); Mon, 17 Nov 2008 09:02:40 -0500 Date: Mon, 17 Nov 2008 14:02:59 +0000 (GMT) From: Hugh Dickins X-X-Sender: hugh@blonde.site To: Victoria Muntean cc: Kernel Linux Subject: Re: size of swapped-out part of the process In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1305 Lines: 31 On Mon, 17 Nov 2008, Victoria Muntean wrote: > How can I calculate size of swapped-out part of the process from > /proc/PID/*, even if approximately ? > For example, I have VmSize=1216192 kB, VmRSS = 628788 kB, but global > swap-in-use==0. > Hence (VmSize - VmRSS) is far from being swapped-out part of the > process. What is ? I'm sorry, we don't record those numbers per process or per mm, so you won't find them in /proc/PID/status or /proc/PID/statm. And we'd probably resist accepting a patch to add them, so as not to enlarge key data structures to hold them. There's also an ambiguity about what "swapped-out" means: does it include shared file pages which were once mapped into the process, but have since been freed under memory pressure? But it looks like you're interested in swapped-out to mean written on swap. In that case, if you have CONFIG_PROC_PAGE_MONITOR=y, you can read /proc/PID/smaps and add up all the "Swap:" lines. But don't keep reading it in a tight loop: that would tend to detract from the performance of your system. Hugh -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/