All of lore.kernel.org
 help / color / mirror / Atom feed
* why ShardedWQ in osd using smart pointer for PG?
@ 2015-11-10 15:19 池信泽
  2015-11-10 18:28 ` Gregory Farnum
  0 siblings, 1 reply; 4+ messages in thread
From: 池信泽 @ 2015-11-10 15:19 UTC (permalink / raw)
  To: ceph-devel

hi, all:

     op_wq is declared as ShardedThreadPool::ShardedWQ < pair <PGRef,
OpRequestRef> > &op_wq. I do not know why we should use PGRef in this?

     Because the overhead of the smart pointer is not small. Maybe the
raw point PG* is also OK?

     If op_wq is changed to ShardedThreadPool::ShardedWQ < pair <PG*,
OpRequestRef> > &op_wq (using raw point)

     the latency for PrioritizedQueue:;enqueue decrease from 3.38us -> 1.89us

     the latency for PrioritizedQueue:;dequeue decrease from 3.44us -> 1.65us

     Is this make sense to you?

-- 
Regards,
xinze

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: why ShardedWQ in osd using smart pointer for PG?
  2015-11-10 15:19 why ShardedWQ in osd using smart pointer for PG? 池信泽
@ 2015-11-10 18:28 ` Gregory Farnum
  2015-11-11  0:20   ` 池信泽
  0 siblings, 1 reply; 4+ messages in thread
From: Gregory Farnum @ 2015-11-10 18:28 UTC (permalink / raw)
  To: 池信泽; +Cc: ceph-devel

On Tue, Nov 10, 2015 at 7:19 AM, 池信泽 <xmdxcxz@gmail.com> wrote:
> hi, all:
>
>      op_wq is declared as ShardedThreadPool::ShardedWQ < pair <PGRef,
> OpRequestRef> > &op_wq. I do not know why we should use PGRef in this?
>
>      Because the overhead of the smart pointer is not small. Maybe the
> raw point PG* is also OK?
>
>      If op_wq is changed to ShardedThreadPool::ShardedWQ < pair <PG*,
> OpRequestRef> > &op_wq (using raw point)
>
>      the latency for PrioritizedQueue:;enqueue decrease from 3.38us -> 1.89us
>
>      the latency for PrioritizedQueue:;dequeue decrease from 3.44us -> 1.65us
>
>      Is this make sense to you?

In general we use PGRefs rather than PG pointers. I think we actually
rely on the references here to keep the PG from going out of scope at
an inopportune time, but if it halves the cost of queuing actions it
might be worth the effort of avoiding that.
-Greg
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: why ShardedWQ in osd using smart pointer for PG?
  2015-11-10 18:28 ` Gregory Farnum
@ 2015-11-11  0:20   ` 池信泽
  2015-11-11  0:22     ` Gregory Farnum
  0 siblings, 1 reply; 4+ messages in thread
From: 池信泽 @ 2015-11-11  0:20 UTC (permalink / raw)
  To: Gregory Farnum; +Cc: ceph-devel

I wonder if we want to keep the PG from going out of scope at an
inopportune time, why snap_trim_queue and scrub_queue declared as
xlist<PG*> instead of xlist<PGRef>?

2015-11-11 2:28 GMT+08:00 Gregory Farnum <gfarnum@redhat.com>:
> On Tue, Nov 10, 2015 at 7:19 AM, 池信泽 <xmdxcxz@gmail.com> wrote:
>> hi, all:
>>
>>      op_wq is declared as ShardedThreadPool::ShardedWQ < pair <PGRef,
>> OpRequestRef> > &op_wq. I do not know why we should use PGRef in this?
>>
>>      Because the overhead of the smart pointer is not small. Maybe the
>> raw point PG* is also OK?
>>
>>      If op_wq is changed to ShardedThreadPool::ShardedWQ < pair <PG*,
>> OpRequestRef> > &op_wq (using raw point)
>>
>>      the latency for PrioritizedQueue:;enqueue decrease from 3.38us -> 1.89us
>>
>>      the latency for PrioritizedQueue:;dequeue decrease from 3.44us -> 1.65us
>>
>>      Is this make sense to you?
>
> In general we use PGRefs rather than PG pointers. I think we actually
> rely on the references here to keep the PG from going out of scope at
> an inopportune time, but if it halves the cost of queuing actions it
> might be worth the effort of avoiding that.
> -Greg



-- 
Regards,
xinze
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: why ShardedWQ in osd using smart pointer for PG?
  2015-11-11  0:20   ` 池信泽
@ 2015-11-11  0:22     ` Gregory Farnum
  0 siblings, 0 replies; 4+ messages in thread
From: Gregory Farnum @ 2015-11-11  0:22 UTC (permalink / raw)
  To: 池信泽; +Cc: ceph-devel

The xlist has means of efficiently removing entries from a list. I
think you'll find those in the path where we start tearing down a PG,
and membership on this list is a bit different from membership in the
ShardedThreadPool. It's all about the particulars of each design, and
I don't have that in my head — you'd need to examine it.
-Greg

On Tue, Nov 10, 2015 at 4:20 PM, 池信泽 <xmdxcxz@gmail.com> wrote:
> I wonder if we want to keep the PG from going out of scope at an
> inopportune time, why snap_trim_queue and scrub_queue declared as
> xlist<PG*> instead of xlist<PGRef>?
>
> 2015-11-11 2:28 GMT+08:00 Gregory Farnum <gfarnum@redhat.com>:
>> On Tue, Nov 10, 2015 at 7:19 AM, 池信泽 <xmdxcxz@gmail.com> wrote:
>>> hi, all:
>>>
>>>      op_wq is declared as ShardedThreadPool::ShardedWQ < pair <PGRef,
>>> OpRequestRef> > &op_wq. I do not know why we should use PGRef in this?
>>>
>>>      Because the overhead of the smart pointer is not small. Maybe the
>>> raw point PG* is also OK?
>>>
>>>      If op_wq is changed to ShardedThreadPool::ShardedWQ < pair <PG*,
>>> OpRequestRef> > &op_wq (using raw point)
>>>
>>>      the latency for PrioritizedQueue:;enqueue decrease from 3.38us -> 1.89us
>>>
>>>      the latency for PrioritizedQueue:;dequeue decrease from 3.44us -> 1.65us
>>>
>>>      Is this make sense to you?
>>
>> In general we use PGRefs rather than PG pointers. I think we actually
>> rely on the references here to keep the PG from going out of scope at
>> an inopportune time, but if it halves the cost of queuing actions it
>> might be worth the effort of avoiding that.
>> -Greg
>
>
>
> --
> Regards,
> xinze
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-11-11  0:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-10 15:19 why ShardedWQ in osd using smart pointer for PG? 池信泽
2015-11-10 18:28 ` Gregory Farnum
2015-11-11  0:20   ` 池信泽
2015-11-11  0:22     ` Gregory Farnum

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.