From: Konstantin Osipov <kostja@tarantool.org> To: tarantool-patches@freelists.org Cc: georgy@tarantool.org Subject: [tarantool-patches] Re: [PATCH] Output of fiber.info will contain only non-idle fibers Date: Tue, 23 Jul 2019 22:56:43 +0300 [thread overview] Message-ID: <20190723195643.GA18567@atlas> (raw) In-Reply-To: <CA+JJC5sfQvNim9NQfaK0St4c+FnTDrtTTu_iiC6g035zh50nfQ@mail.gmail.com> * Maria K <marianneliash@gmail.com> [19/07/23 21:01]: > The output used to be too cluttered due to idle ones. > > Closes #4235 @kyukhin, first, please I don't get how does this get scheduled to a milestone? How does this follow triage guidelines? Please don't schedule anything that is not a priority, even if it's a noob issue, since it takes time of everyone involved. fiber.info() already doesn't show anything from cord->dead list. Fibers which are stuck in a pool are performing application-level code, even if it's a built in pool, so contribute valuable information to fiber.info() output. Besides, it's always easy to filter out any class of fibers with luafun. Finally, there are other types of pools -- an application-level pool in Lua will have lots of idle fibers in it. In other words, this is an partial fix of a raw feature request. Tarantool instrumentation sucks, but it doesn't mean it should be patched by quick hacks here and there. A nice and general solution would be to compress mostly identical fiber.info() entries. But I guess it's not a noob task. > --- > src/lib/core/fiber.c | 3 ++- > src/lib/core/fiber.h | 10 ++++++++++ > src/lib/core/fiber_pool.c | 2 ++ > 3 files changed, 14 insertions(+), 1 deletion(-) > > diff --git a/src/lib/core/fiber.c b/src/lib/core/fiber.c > index ce90f930c..b1d7a5be2 100644 > --- a/src/lib/core/fiber.c > +++ b/src/lib/core/fiber.c > @@ -1411,7 +1411,8 @@ int fiber_stat(fiber_stat_cb cb, void *cb_ctx) > struct cord *cord = cord(); > int res; > rlist_foreach_entry(fiber, &cord->alive, link) { > - res = cb(fiber, cb_ctx); > + if (!fiber_is_idle(fiber)) > + res = cb(fiber, cb_ctx); > if (res != 0) > return res; > } > diff --git a/src/lib/core/fiber.h b/src/lib/core/fiber.h > index fb168e25e..d05132a8d 100644 > --- a/src/lib/core/fiber.h > +++ b/src/lib/core/fiber.h > @@ -97,6 +97,10 @@ enum { > * This flag is set when fiber uses custom stack size. > */ > FIBER_CUSTOM_STACK = 1 << 5, > + /* > + * > + */ > + FIBER_IS_IDLE = 1 << 6, > FIBER_DEFAULT_FLAGS = FIBER_IS_CANCELLABLE > }; > > @@ -620,6 +624,12 @@ fiber_is_dead(struct fiber *f) > return f->flags & FIBER_IS_DEAD; > } > > +static inline bool > +fiber_is_idle(struct fiber *f) > +{ > + return f->flags & FIBER_IS_IDLE; > +} > + > typedef int (*fiber_stat_cb)(struct fiber *f, void *ctx); > > int > diff --git a/src/lib/core/fiber_pool.c b/src/lib/core/fiber_pool.c > index 77f89c9fa..c04141e63 100644 > --- a/src/lib/core/fiber_pool.c > +++ b/src/lib/core/fiber_pool.c > @@ -72,8 +72,10 @@ restart: > * Add the fiber to the front of the list, so that > * it is most likely to get scheduled again. > */ > + f->flags |= FIBER_IS_IDLE; > rlist_add_entry(&pool->idle, fiber(), state); > fiber_yield(); > + f->flags &= ~FIBER_IS_IDLE; > goto restart; > } > pool->size--; > -- > 2.21.0 -- Konstantin Osipov, Moscow, Russia
next prev parent reply other threads:[~2019-07-23 19:56 UTC|newest] Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-07-23 18:00 [tarantool-patches] " Maria K 2019-07-23 19:56 ` Konstantin Osipov [this message] 2019-07-24 8:00 ` [tarantool-patches] " Kirill Yukhin 2019-07-24 15:11 ` Konstantin Osipov 2019-07-25 6:14 ` Георгий Кириченко 2019-07-25 9:26 ` Konstantin Osipov 2019-07-25 13:02 ` Георгий Кириченко
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=20190723195643.GA18567@atlas \ --to=kostja@tarantool.org \ --cc=georgy@tarantool.org \ --cc=tarantool-patches@freelists.org \ --subject='[tarantool-patches] Re: [PATCH] Output of fiber.info will contain only non-idle fibers' \ /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