From owner-freebsd-current@FreeBSD.ORG Sat Jan 31 15:12:29 2015 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 55080573 for ; Sat, 31 Jan 2015 15:12:29 +0000 (UTC) Received: from sasl.smtp.pobox.com (pb-smtp1.int.icgroup.com [208.72.237.35]) by mx1.freebsd.org (Postfix) with ESMTP id 242EB7BE for ; Sat, 31 Jan 2015 15:12:28 +0000 (UTC) Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id B08492FFD6 for ; Sat, 31 Jan 2015 10:08:18 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=message-id :date:from:mime-version:to:subject:content-type; s=sasl; bh=Egm6 TEK3DezAtV5TAOq1jUFxO7A=; b=QowsyHwtspuPqoABzG4Z3OWdD05uQNZNrVy2 oVGn3fX6XydSCsxFrOSIcas2IAXDojY3M91g/o5xC3cOZtxbnYutXW4ZlQ65ouOG m0a+TsfiopHe854l1hVmKlX9zlzLCdEC31L19wlxLfzezEB/2GTKG5iOymalj/RX f8EVO5k= Received: from pb-smtp1.int.icgroup.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id A7B8E2FFD5 for ; Sat, 31 Jan 2015 10:08:18 -0500 (EST) Received: from [192.168.1.103] (unknown [73.164.1.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pb-smtp1.pobox.com (Postfix) with ESMTPSA id 10D932FFD3 for ; Sat, 31 Jan 2015 10:08:17 -0500 (EST) Message-ID: <54CCEFAB.9040406@badgerio.us> Date: Sat, 31 Jan 2015 09:07:23 -0600 From: Eric Badger User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: freebsd-current@freebsd.org Subject: Filepaths in VM map for tmpfs files Content-Type: multipart/mixed; boundary="------------010102060709010900020003" X-Pobox-Relay-ID: FCC92A3E-A95A-11E4-A4AA-7BA29F42C9D4-46178211!pb-smtp1.pobox.com X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Jan 2015 15:12:29 -0000 This is a multi-part message in MIME format. --------------010102060709010900020003 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit In FreeBSD 9, examining the VM map of a process (with e.g. 'procstat -v') with a tmpfs file mapped showed a VNODE type and displayed the file path. In 10.0 up to CURRENT (I believe this started at r250030), instead SWAP is shown without a filepath. This has some unfortunate consequences; I discovered this problem when trying to use dtrace's pid provider, which fails to find symbols for executables running from tmpfs. I've attached a patch which will repair procstat/dtrace. There are a few other places such a patch would be needed. I'm willing to put together such a patch, but would like to first hear some feedback that this seems like a reasonable approach, or if there's anything I've missed. Thoughts? Eric --------------010102060709010900020003 Content-Type: text/x-patch; name="tmpfs_vnode.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="tmpfs_vnode.diff" Index: sys/kern/kern_proc.c =================================================================== --- sys/kern/kern_proc.c (revision 277957) +++ sys/kern/kern_proc.c (working copy) @@ -2337,6 +2337,11 @@ break; case OBJT_SWAP: kve->kve_type = KVME_TYPE_SWAP; + if ((lobj->flags & OBJ_TMPFS) != 0) + { + vp = lobj->un_pager.swp.swp_tmpfs; + vref(vp); + } break; case OBJT_DEVICE: kve->kve_type = KVME_TYPE_DEVICE; --------------010102060709010900020003--