From: Sergey Kaplun <skaplun@tarantool.org> To: Igor Munkin <imun@tarantool.org> Cc: tarantool-patches@dev.tarantool.org Subject: Re: [Tarantool-patches] [PATCH 1/2] metrics: add counters for metrics interested in Date: Sat, 25 Jul 2020 13:00:03 +0300 [thread overview] Message-ID: <20200725100003.GA27362@root> (raw) In-Reply-To: <20200724200501.GT18920@tarantool.org> On 24.07.20, Igor Munkin wrote: > Sergey, > > On 24.07.20, Sergey Kaplun wrote: > > Hi Igor! Thanks for the review! > > > > On 23.07.20, Igor Munkin wrote: > > > Sergey, > > > > > > Thanks for the patch! Please consider my comments below. > > > > > > On 21.07.20, Sergey Kaplun wrote: > > > > > > We still don't have strict prefixes, so I propose to use 'core' for this > > > patch. Does it look fine to you? Feel free to propose your own one. > > > > Maybe we should use 'misc' for this kind of patches? > > Pardon, I don't get your proposal: > * if you refer the introduced <misc> library, then no, cause this > patch doesn't relate to it > * if you refer to "miscellaneous changes", then also no, cause this > patch directly related to the core components of platform runtime > (e.g. GC machinery, string interning and lookup, JIT engine). > You are right, I'll use "core" here. <snipped> > > > > +}; > > > > + > > > > typedef struct GCState { > > > > GCSize total; /* Memory currently allocated. */ > > > > + size_t freed; /* Memory freed since last luaM_metrics() call. */ > > > > + size_t allocated; /* Memory allocated since last luaM_metrics() call. */ > > > > > > Well, why <total> field type differs from <freed> and <allocated> fields > > > type? And again, remark about <luaM_metrics> can be dropped (see above). > > > > GCSize for total memfory usage is defines by LJ_GC64 macro definition. > > | #if LJ_GC64 > > | typedef uint64_t GCSize; > > | #else > > | typedef uint32_t GCSize; > > | #endif > > > > But summarized allocation size can be many times over maximum memory > > size). So these field types should be independet. > > OK, thanks, now I see. However, there is another issue with these > fields: if LJ_GC64 is disabled (AFAIR any Tarantool build except MacOS > ones) the structure will have unused pad after <total> field. Otherwise, > if LuaJIT is build in LJ_GC64 mode, such pad occurs after <unused2> > field due to <state_count> field. Please reorder the fields considering > the structure alignment. Sure! > > <snipped> > > > > > > +#endif > > > > } GCState; > > > > > > > > /* Global state, shared by all threads of a Lua universe. */ > > > > @@ -602,6 +623,10 @@ typedef struct global_State { > > > > BloomFilter next[2]; > > > > } strbloom; > > > > #endif > > > > + size_t strhash_hit; /* New string has been found in the storage > > > > + ** since last luaM_metrics() call. */ > > > > + size_t strhash_miss; /* New string has been added to the storage > > > > + ** since last luaM_metrics() call. */ > > > > > > Well, such indentation is closer to the desired one, but I would use two > > > spaces prior to these tabs. What do you think? Also please, don't forget > > > about <luaM_metrics> remark. > > > > Sorry, but ^\s+\t+\s+ stylistics looks very bad. In *.c files Mike use > > exactly ^\t+ style for code, so we have to use the same for comments. > > > > Thoughts? > > I failed to find multiline comments for structures. So if you need one, > it looks more convenient to me to save the original indent of the > structure (i.e. spaces) and then align the wording with tabs considering > the first line. Or make the situation much easier to you and other > developers: just avoid multiline inline comments :) I suppose that one-line comment will satisfy both of us :) > > > > > > lua_Alloc allocf; /* Memory allocator. */ > > > > void *allocd; /* Memory allocator data. */ > > > > GCState gc; /* Garbage collector. */ > > <snipped> > > > > > -- > > > > 2.24.1 > > > > > > > > > > -- > > > Best regards, > > > IM > > > > [1]: https://lists.tarantool.org/pipermail/tarantool-patches/2020-July/018845.html > > > > -- > > Best regards, > > Sergey Kaplun > > -- > Best regards, > IM -- Best regards, Sergey Kaplun
next prev parent reply other threads:[~2020-07-25 10:00 UTC|newest] Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-07-21 11:34 [Tarantool-patches] [PATCH 0/2] Implement LuaJIT platform metrics Sergey Kaplun 2020-07-21 11:34 ` [Tarantool-patches] [PATCH 1/2] metrics: add counters for metrics interested in Sergey Kaplun 2020-07-23 20:12 ` Igor Munkin 2020-07-24 12:00 ` Sergey Kaplun 2020-07-24 20:05 ` Igor Munkin 2020-07-25 10:00 ` Sergey Kaplun [this message] 2020-07-27 2:25 ` Sergey Kaplun 2020-08-12 9:39 ` Igor Munkin 2020-07-21 11:34 ` [Tarantool-patches] [PATCH 2/2] metrics: add C and Lua API Sergey Kaplun 2020-07-21 11:37 ` [Tarantool-patches] [RFC] rfc: luajit metrics Sergey Kaplun 2020-07-23 10:15 ` Sergey Ostanevich 2020-07-24 11:18 ` Sergey Kaplun 2020-07-24 11:22 ` Sergey Kaplun 2020-07-24 17:20 ` Sergey Ostanevich 2020-07-27 2:18 ` Sergey Kaplun 2020-08-11 20:13 ` Igor Munkin
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20200725100003.GA27362@root \ --to=skaplun@tarantool.org \ --cc=imun@tarantool.org \ --cc=tarantool-patches@dev.tarantool.org \ --subject='Re: [Tarantool-patches] [PATCH 1/2] metrics: add counters for metrics interested in' \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox