Return-Path: Delivered-To: apmail-incubator-harmony-dev-archive@www.apache.org Received: (qmail 55353 invoked from network); 3 Nov 2006 16:05:54 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 3 Nov 2006 16:05:54 -0000 Received: (qmail 10987 invoked by uid 500); 3 Nov 2006 16:05:55 -0000 Delivered-To: apmail-incubator-harmony-dev-archive@incubator.apache.org Received: (qmail 10957 invoked by uid 500); 3 Nov 2006 16:05:55 -0000 Mailing-List: contact harmony-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: harmony-dev@incubator.apache.org Delivered-To: mailing list harmony-dev@incubator.apache.org Received: (qmail 10939 invoked by uid 99); 3 Nov 2006 16:05:55 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Nov 2006 08:05:55 -0800 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of weldonwjw@gmail.com designates 64.233.184.229 as permitted sender) Received: from [64.233.184.229] (HELO wr-out-0506.google.com) (64.233.184.229) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Nov 2006 08:05:40 -0800 Received: by wr-out-0506.google.com with SMTP id 58so72824wri for ; Fri, 03 Nov 2006 08:05:20 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=VC04YCd4w3OTtQmoIhr6ZPxyUaQv/bUeCoxhRM30GLqludpmCzS/g/awxvbEQDhGa2cVec+N7VjWHWOrc3IRzkwxj+JbE/OP4fSzDTV9vEKL5uydolEobNkxFe+0yqoxDt4c7EiQqnDwTNHEVqcEip4CutFst/Y1p6WeTCXEBN0= Received: by 10.78.128.15 with SMTP id a15mr3048755hud.1162569918962; Fri, 03 Nov 2006 08:05:18 -0800 (PST) Received: by 10.78.137.2 with HTTP; Fri, 3 Nov 2006 08:05:18 -0800 (PST) Message-ID: <4dd1f3f00611030805l7ec7f3c6ra833e4e725af0e39@mail.gmail.com> Date: Fri, 3 Nov 2006 08:05:18 -0800 From: "Weldon Washburn" To: harmony-dev@incubator.apache.org Subject: Re: [drlvm] dynamic object layout In-Reply-To: <454B4806.8040803@Intel.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_18235_5750704.1162569918922" References: <454B4806.8040803@Intel.com> X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_18235_5750704.1162569918922 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Salikh, I glanced at the patch. What you propose below looks reasonable. I really don't see any other way to do it and still get "usable" performance. All, My only worry is disturbing highly critical code like object layout. Given that this JIRA has been open a long time, I guess its OK to apply the patch. At some point, we need to stop adding functionality and focus on stability. On 11/3/06, Salikh Zakirov wrote: > > Hi, > > I am currently continuing to work on improving JVMTI Heap Iteration > (HARMONY-1635), > particularly, tagging objects. > > The use case that I've heard of is tagging *all* objects for the purpose > of memory > profiling. According to what I've heard it causes 60x slowdown on Sun's > VM. > However, the initial tags implementation that I've uploaded to > HARMONY-1635 > is far worse, as it uses linear search for get/set tag operations. > > (* for those who didn't read JVMTI spec, tags are jlong (8 byte integer) > values, > which can be attached to arbitrary objects in get/set manner *) > > The alternative approach I came up with is to use (mostly) constant time > algorithms > for get/set operations, is to store a tag pointer in each object. > Storing tag itself in an object is not an option, as JVMTI requires to > send > OBJECT_FREE events with tags for each reclaimed objects, and this > information would not be > available if the tag would be reclaimed together with the object. > > However, since the general consensus was that increasing object header is > highly undesired, > I've tried to implement the _conditional_ increase in object header. > Additional object header field is allocated in case JVMTI Agent has > requested > can_tag_objects capability. > > The modified object layout I used is as follows: > > +-------------------+ > | VTable pointer | > +-------------------+ > | lockword | > +-------------------+ > | [array length] | > +-------------------+ > | [tag pointer] | > +-------------------+ > | [padding] | > +-------------------+ > | fields or elements| > | ... | > +-------------------+ > > Where [array length] is only present in array objects, > [tag pointer] is only present when can_tag_capability has been enabled at > startup > [padding] is only present in arrays of longs and doubles for natural > 8-byte alignment. > > VTable pointer is really uint32 offset on em64t/x86_64 and ipf/ia64. > > The only difference with current object layout is introduction of tag > pointer field. > > I've modified gc_cc to take the changed dynamic object layout into > account, > and surprisingly it took only one modification: > > * use VM function vector_first_element_offset_unboxed() instead of > hardcoding > first array element offset. This is done once for each class done at > loading stage, > and gc_cc caches this offset for later uses. > > I've experimented with putting tag pointer at fixed location before array > length, > but it looks expensive, as it will add one more read to GC array scanning, > and > we obviously do not want optimize at the expense of common case. > > The latest version of the patch is attached to HARMONY-1635 ( > heap-iteration-optimized.patch), > I would appreciate any comments and concerns. > > > -- Weldon Washburn Intel Enterprise Solutions Software Division ------=_Part_18235_5750704.1162569918922--