From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from tb-mx1.topicbox.com (localhost.local [127.0.0.1]) by tb-mx1.topicbox.com (Postfix) with ESMTP id 113D433803A8 for <9fans@9fans.net>; Sat, 15 Aug 2020 00:51:13 -0400 (EDT) (envelope-from ality@pbrane.org) Received: from tb-mx1.topicbox.com (localhost [127.0.0.1]) by tb-mx1.topicbox.com (Authentication Milter) with ESMTP id D4BDDC0ADD1; Sat, 15 Aug 2020 00:51:13 -0400 ARC-Seal: i=1; a=rsa-sha256; cv=none; d=topicbox.com; s=arcseal; t= 1597467073; b=qYBsMSY4LBzNIMw2+Jkz5iJtlCrukde0284EdFPRRcCN21JRbk /LZi83HaYD49oe/+ZjGkqSpuhXxLSllR6TCfvodgdv8NunMKR5GJZ37K3e3Jl3Nz 5JYrTbRJOhE81d38tCXLvlUSGcW0sT9lijZrW/z4q1ppgPYI1uXvS1zKHRnfxks6 q9er3/aaFXasCgSWnfyHIaqJu2NDEojN2tmcOnGxv4/VEWah/lufarYd4ECW1Ux+ wvfA3nGmsgouUK3clOb+8IEhiessq2pCNI3uGumDrisci7fKAp0afSNFHa2fyuDQ aN8WZ6XptRTPIx2zOHCaZlD9PZnHOMKZgB9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d= topicbox.com; h=date:from:to:subject:message-id:references :mime-version:content-type:in-reply-to; s=arcseal; t=1597467073; bh=wdWDS7t834oPPGLBIkoDZ4ICnF0f6Qh/NMFN7O/bwno=; b=rTautMgTayN5 eQ9rQyPV8v80nOI5IGAiMsgeUyHcKdtyaZ4BXmSPS/fLQTrdOUpusY8MOVg6Kxh3 Z8M8b0+tU4bsUsv1xyEuHv89sItfmJcQH/QWfjEZja9nZKty3fOWij+FcGLeHato pQYNS4LVFGTKHevoWbbraWUCPNqTLb8fWHwy6gcVJL/dN+5z9LCkr4zywUMkOuh2 VbdXjQb/ihS2z8RiZeGrgFfyXvUF9Y04FUWHsplpc3pYvYxg3rdBnReMzcpMxE8Z V1rwJnIOfre2vMKy1TITjT4J+zeO68puI1R7VaO3936gTI+EvHVJ+1JTb7Y+PtFw bcrjVeAwZg== ARC-Authentication-Results: i=1; tb-mx1.topicbox.com; arc=none (no signatures found); bimi=skipped (DMARC none); dkim=none (no signatures found); dmarc=none policy.published-domain-policy=none policy.applied-disposition=none policy.evaluated-disposition=none (p=none,d=none,d.eval=none) policy.policy-from=p header.from=pbrane.org; iprev=pass smtp.remote-ip=68.65.122.30 (mta-10-1.privateemail.com); spf=pass smtp.mailfrom=ality@pbrane.org smtp.helo=MTA-10-1.privateemail.com; x-aligned-from=pass (Address match); x-ptr=pass smtp.helo=MTA-10-1.privateemail.com policy.ptr=mta-10-1.privateemail.com; x-return-mx=pass header.domain=pbrane.org policy.is_org=yes (MX Records found: mx2.privateemail.com,mx1.privateemail.com); x-return-mx=pass smtp.domain=pbrane.org policy.is_org=yes (MX Records found: mx2.privateemail.com,mx1.privateemail.com); x-tls=pass smtp.version=TLSv1.2 smtp.cipher=ECDHE-RSA-AES256-GCM-SHA384 smtp.bits=256/256; x-vs=clean score=0 state=0 Authentication-Results: tb-mx1.topicbox.com; arc=none (no signatures found); bimi=skipped (DMARC none); dkim=none (no signatures found); dmarc=none policy.published-domain-policy=none policy.applied-disposition=none policy.evaluated-disposition=none (p=none,d=none,d.eval=none) policy.policy-from=p header.from=pbrane.org; iprev=pass smtp.remote-ip=68.65.122.30 (mta-10-1.privateemail.com); spf=pass smtp.mailfrom=ality@pbrane.org smtp.helo=MTA-10-1.privateemail.com; x-aligned-from=pass (Address match); x-ptr=pass smtp.helo=MTA-10-1.privateemail.com policy.ptr=mta-10-1.privateemail.com; x-return-mx=pass header.domain=pbrane.org policy.is_org=yes (MX Records found: mx2.privateemail.com,mx1.privateemail.com); x-return-mx=pass smtp.domain=pbrane.org policy.is_org=yes (MX Records found: mx2.privateemail.com,mx1.privateemail.com); x-tls=pass smtp.version=TLSv1.2 smtp.cipher=ECDHE-RSA-AES256-GCM-SHA384 smtp.bits=256/256; x-vs=clean score=0 state=0 X-ME-VSCause: gggruggvucftvghtrhhoucdtuddrgeduiedrleekgdeklecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecunecujfgurhepfffhvffukf hfgggtuggjsehttdertddttddvnecuhfhrohhmpeetnhhthhhonhihucforghrthhinhcu oegrlhhithihsehpsghrrghnvgdrohhrgheqnecuggftrfgrthhtvghrnhepkefhvdfhud ffvdevjeehgeevgedugffhgfdvkeektedtffduudevjeetfefhhefgnecukfhppeeikedr ieehrdduvddvrdeftdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvg htpeeikedrieehrdduvddvrdeftddphhgvlhhopefovfetqddutddquddrphhrihhvrght vggvmhgrihhlrdgtohhmpdhmrghilhhfrhhomhepoegrlhhithihsehpsghrrghnvgdroh hrghequcfukfgkgfepudeijedu X-ME-VSScore: 0 X-ME-VSCategory: clean Received-SPF: pass (pbrane.org: Sender is authorized to use 'ality@pbrane.org' in 'mfrom' identity (mechanism 'include:spf.privateemail.com' matched)) receiver=tb-mx1.topicbox.com; identity=mailfrom; envelope-from="ality@pbrane.org"; helo=MTA-10-1.privateemail.com; client-ip=68.65.122.30 Received: from MTA-10-1.privateemail.com (mta-10-1.privateemail.com [68.65.122.30]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by tb-mx1.topicbox.com (Postfix) with ESMTPS for <9fans@9fans.net>; Sat, 15 Aug 2020 00:51:12 -0400 (EDT) (envelope-from ality@pbrane.org) Received: from MTA-10.privateemail.com (localhost [127.0.0.1]) by MTA-10.privateemail.com (Postfix) with ESMTP id 1D79360047 for <9fans@9fans.net>; Sat, 15 Aug 2020 00:51:10 -0400 (EDT) Received: from localhost (unknown [10.20.151.248]) by MTA-10.privateemail.com (Postfix) with ESMTPA id 451A360038 for <9fans@9fans.net>; Sat, 15 Aug 2020 04:51:09 +0000 (UTC) Date: Fri, 14 Aug 2020 21:50:57 -0700 From: Anthony Martin To: 9fans <9fans@9fans.net> Subject: Re: /proc/n/status's memory field Message-ID: <20200815045057.GA585648@alice> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Virus-Scanned: ClamAV using ClamSMTP Topicbox-Policy-Reasoning: allow: sender is a member Topicbox-Message-UUID: f439c4b2-deb2-11ea-82b2-f02097531bf5 Kyohei Kadota once said: > I'm reading proc(3). It describes the status file: > > > the amount of memory used by the process, except its stack, in units of 1024 bytes > > In /sys/src/9/pc/port/proc.c, it seems to me that procread sums all > segment's size for that. > Is the above statement correct? The Labs kernel loops over [1,NSEG) to sum the segment sizes. The index of the stack segment, SSEG, is zero so it is skipped. This measurement is the total virtual address space in use by the process minus the stack. The 9front kernel loops over [0,NSEG) to scan the virtual page table of each segment for used pages, summing as it goes. This measurement is the total amount of memory in use by the process. Cheers, Anthony