[jira] [Commented] (TS-4316) Slot accelerator doesn't effect under certain condition

2016-09-09 Thread Alan M. Carroll (JIRA)

[ 
https://issues.apache.org/jira/browse/TS-4316?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15477282#comment-15477282
 ] 

Alan M. Carroll commented on TS-4316:
-

Yes. This is why I would recommend as a next step enhancing Petar's header 
counter, which will be used to get commonality data for updating the WKS list. 
I don't think it would be much work to have it do a histogram on the number of 
headers also. if it's rare for a request to have 14 headers then this isn't a 
problem. If 14 or more is common we could do a bit of math to see how likely it 
is for a WKS to in an unknown slot.  There is likely to be more data we could 
gather this way.

> Slot accelerator doesn't effect under certain condition
> ---
>
> Key: TS-4316
> URL: https://issues.apache.org/jira/browse/TS-4316
> Project: Traffic Server
>  Issue Type: Bug
>  Components: MIME
>Reporter: Masakazu Kitajo
>Assignee: Alan M. Carroll
> Fix For: sometime
>
>
> Slot accelerators seem to not effect if the stored slot number is 14 or 15.
> This is because {{mime_hdr_set_accelerators_and_presence_bits()}} regards 
> slot number 14+ as "unknown" and stores MIME_FIELD_SLOTNUM_UNKNOWN(14) to an 
> accelerator, and it causes slower search. Although there is no critical 
> effect, it would decreases performance slightly.
> The numbers, 14 and 15, comes from constants below in MIME.h:
> {code}
> #define MIME_FIELD_SLOTNUM_BITS 4
> #define MIME_FIELD_SLOTNUM_MASK ((1 << MIME_FIELD_SLOTNUM_BITS) - 1)
> #define MIME_FIELD_SLOTNUM_MAX (MIME_FIELD_SLOTNUM_MASK - 1)
> #define MIME_FIELD_SLOTNUM_UNKNOWN MIME_FIELD_SLOTNUM_MAX
> {code}
> MIME_FIELD_SLOTNUM_MASK is 15.
> MIME_FIELD_SLOTNUM_MAX is 14.
> MIME_FIELD_SLOTNUM_UNKNOWN is 14 too.
> Though it still needs more careful confirmation, it seems we can simply 
> change {{MIME_FIELD_SLOTNUM_UNKNOWN}} to the value of 
> {{MIME_FIELD_SLOTNUM_MASK}} (15). But we still cannot use 15.
> To use 15 as a valid slot number in slot accelerators, we need to change 
> {{MIME_FIELD_SLOTNUM_UNKNOWN}} to 16 or -1, however it would need to change 
> some codes also (not only the number).
> This bug has been found while I was tackling TS-4313.
> https://github.com/apache/trafficserver/pull/542#discussion-diff-58226891



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (TS-4316) Slot accelerator doesn't effect under certain condition

2016-09-08 Thread Masakazu Kitajo (JIRA)

[ 
https://issues.apache.org/jira/browse/TS-4316?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15475544#comment-15475544
 ] 

Masakazu Kitajo commented on TS-4316:
-

{quote}
The question is not whether this occurs, but how often. Is this rare or common?
{quote}
I don't know how often it occurs and how much it affects performance. I just 
realized this can be occurred, and I thought it has negative effect.

{quote}
If the slot index accelerators where changed to be 8 bits, then only headers 
stored in slots past 253 would need to be searched, which should be large 
enough for quite some time. This would add only 16 bytes per alternate.
{quote}
I agree. The percentage of unlucky scenario would be much decreased.
2 / 16 = 0.125
2 / 256 = 0.0078125

> Slot accelerator doesn't effect under certain condition
> ---
>
> Key: TS-4316
> URL: https://issues.apache.org/jira/browse/TS-4316
> Project: Traffic Server
>  Issue Type: Bug
>  Components: MIME
>Reporter: Masakazu Kitajo
>Assignee: Alan M. Carroll
> Fix For: sometime
>
>
> Slot accelerators seem to not effect if the stored slot number is 14 or 15.
> This is because {{mime_hdr_set_accelerators_and_presence_bits()}} regards 
> slot number 14+ as "unknown" and stores MIME_FIELD_SLOTNUM_UNKNOWN(14) to an 
> accelerator, and it causes slower search. Although there is no critical 
> effect, it would decreases performance slightly.
> The numbers, 14 and 15, comes from constants below in MIME.h:
> {code}
> #define MIME_FIELD_SLOTNUM_BITS 4
> #define MIME_FIELD_SLOTNUM_MASK ((1 << MIME_FIELD_SLOTNUM_BITS) - 1)
> #define MIME_FIELD_SLOTNUM_MAX (MIME_FIELD_SLOTNUM_MASK - 1)
> #define MIME_FIELD_SLOTNUM_UNKNOWN MIME_FIELD_SLOTNUM_MAX
> {code}
> MIME_FIELD_SLOTNUM_MASK is 15.
> MIME_FIELD_SLOTNUM_MAX is 14.
> MIME_FIELD_SLOTNUM_UNKNOWN is 14 too.
> Though it still needs more careful confirmation, it seems we can simply 
> change {{MIME_FIELD_SLOTNUM_UNKNOWN}} to the value of 
> {{MIME_FIELD_SLOTNUM_MASK}} (15). But we still cannot use 15.
> To use 15 as a valid slot number in slot accelerators, we need to change 
> {{MIME_FIELD_SLOTNUM_UNKNOWN}} to 16 or -1, however it would need to change 
> some codes also (not only the number).
> This bug has been found while I was tackling TS-4313.
> https://github.com/apache/trafficserver/pull/542#discussion-diff-58226891



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (TS-4316) Slot accelerator doesn't effect under certain condition

2016-09-08 Thread Alan M. Carroll (JIRA)

[ 
https://issues.apache.org/jira/browse/TS-4316?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15474233#comment-15474233
 ] 

Alan M. Carroll commented on TS-4316:
-

In that particular case the "Accept" header is stored in a slot past 13 (it's 
not necessarily in 14, it might be in 18 for instance, but certainly beyond 
what 4 bits can index). But that's very dependent on the ordering and number of 
headers in this specific request. For example, if the request had only 10 
headers none would be stored in slots past 9. The question is not whether this 
occurs, but how often. Is this rare or common?

Here is an example where "Accept" is stored in slot 2 -

{code}
(gdb) p *mh
$2 = { = {m_type = 4, m_length = 592, m_obj_flags = 0}, 
m_presence_bits = 2252899342090241, m_slot_accelerators = {
4294967282, 4294967295, 1073741823, 4294049791}, m_cooked_stuff = 
{m_cache_control = {m_mask = 0, m_secs_max_age = 0, 
  m_secs_s_maxage = 0, m_secs_max_stale = 0, m_secs_min_fresh = 0}, 
m_pragma = {m_no_cache = false}}, 
  m_fblock_list_tail = 0x700a28f8, m_first_fblock = { = 
{m_type = 5, m_length = 528, m_obj_flags = 0}, 
m_freetop = 4, m_next = 0x0, m_field_slots = {{
m_ptr_name = 0x7fffc408f028 "Host: scrapyard\r\nUser-Agent: 
curl/7.43.0\r\nAccept: */*\r\nProxy-Connection: 
Keep-Alive\r\n\r\n\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276",
 ..., 
m_ptr_value = 0x7fffc408f02e "scrapyard\r\nUser-Agent: 
curl/7.43.0\r\nAccept: */*\r\nProxy-Connection: 
Keep-Alive\r\n\r\n\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ"...,
 m_next_dup = 0x0, m_wks_idx = 30, m_len_name = 4, m_len_value = 9, 
m_n_v_raw_printable = 1 '\001', 
m_n_v_raw_printable_pad = 4 '\004', m_readiness = 2 '\002', m_flags = 1 
'\001'}, {
m_ptr_name = 0x7fffc408f039 "User-Agent: curl/7.43.0\r\nAccept: 
*/*\r\nProxy-Connection: 
Keep-Alive\r\n\r\n\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357",
 ..., 
m_ptr_value = 0x7fffc408f045 "curl/7.43.0\r\nAccept: 
*/*\r\nProxy-Connection: 
Keep-Alive\r\n\r\n\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357",
 ..., m_next_dup = 0x0, m_wks_idx = 64, 
m_len_name = 10, m_len_value = 11, m_n_v_raw_printable = 1 '\001', 
m_n_v_raw_printable_pad = 4 '\004', 
m_readiness = 2 '\002', m_flags = 1 '\001'}, {
m_ptr_name = 0x7fffc408f052 "Accept: */*\r\nProxy-Connection: 
Keep-Alive\r\n\r\n\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ"...,
 
m_ptr_value = 0x7fffc408f05a "*/*\r\nProxy-Connection: 
Keep-Alive\r\n\r\n\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ"...,
 m_next_dup = 0x0, m_wks_idx = 4, 
m_len_name = 6, m_len_value = 3, m_n_v_raw_printable = 1 '\001', 
m_n_v_raw_printable_pad = 4 '\004', m_readiness = 2 '\002', 
m_flags = 1 '\001'}, {
m_ptr_name = 0x7fffc408f05f "Proxy-Connection: 
Keep-Alive\r\n\r\n\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276"...,
 
m_ptr_value = 0x7fffc408f071 
"Keep-Alive\r\n\r\n\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357ޭ\276\357

[jira] [Commented] (TS-4316) Slot accelerator doesn't effect under certain condition

2016-09-07 Thread Masakazu Kitajo (JIRA)

[ 
https://issues.apache.org/jira/browse/TS-4316?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15472774#comment-15472774
 ] 

Masakazu Kitajo commented on TS-4316:
-

Maybe I misunderstand something, but it seems "Accept" header is stored in slot 
14.

HdrToken.h
{noformat}
#define MIME_SLOTID_ACCEPT 0
{noformat}

MIME.cc:1325
{noformat}
* thread #1: tid = 0x9207e, 0x0001000130d6 
test_mime`mime_hdr_field_find(mh=0x00010068b888, field_name_str="Accept", 
field_name_len=6) + 198 at MIME.cc:1325, queue = 'com.apple.main-thread', stop 
reason = step over
frame #0: 0x0001000130d6 
test_mime`mime_hdr_field_find(mh=0x00010068b888, field_name_str="Accept", 
field_name_len=6) + 198 at MIME.cc:1325
   1322 if (slot_id != MIME_SLOTID_NONE) {
   1323   uint32_t slotnum = mime_hdr_get_accelerator_slotnum(mh, slot_id);
   1324 
-> 1325   if (slotnum != MIME_FIELD_SLOTNUM_UNKNOWN) {
   1326 MIMEField *f = _mime_hdr_field_list_search_by_slotnum(mh, 
slotnum);
   1327 ink_assert((f == NULL) || f->is_live());
   1328 #if TRACK_FIELD_FIND_CALLS
(lldb) p slotnum
(uint32_t) $6 = 14
{noformat}

> Slot accelerator doesn't effect under certain condition
> ---
>
> Key: TS-4316
> URL: https://issues.apache.org/jira/browse/TS-4316
> Project: Traffic Server
>  Issue Type: Bug
>  Components: MIME
>Reporter: Masakazu Kitajo
>Assignee: Alan M. Carroll
> Fix For: sometime
>
>
> Slot accelerators seem to not effect if the stored slot number is 14 or 15.
> This is because {{mime_hdr_set_accelerators_and_presence_bits()}} regards 
> slot number 14+ as "unknown" and stores MIME_FIELD_SLOTNUM_UNKNOWN(14) to an 
> accelerator, and it causes slower search. Although there is no critical 
> effect, it would decreases performance slightly.
> The numbers, 14 and 15, comes from constants below in MIME.h:
> {code}
> #define MIME_FIELD_SLOTNUM_BITS 4
> #define MIME_FIELD_SLOTNUM_MASK ((1 << MIME_FIELD_SLOTNUM_BITS) - 1)
> #define MIME_FIELD_SLOTNUM_MAX (MIME_FIELD_SLOTNUM_MASK - 1)
> #define MIME_FIELD_SLOTNUM_UNKNOWN MIME_FIELD_SLOTNUM_MAX
> {code}
> MIME_FIELD_SLOTNUM_MASK is 15.
> MIME_FIELD_SLOTNUM_MAX is 14.
> MIME_FIELD_SLOTNUM_UNKNOWN is 14 too.
> Though it still needs more careful confirmation, it seems we can simply 
> change {{MIME_FIELD_SLOTNUM_UNKNOWN}} to the value of 
> {{MIME_FIELD_SLOTNUM_MASK}} (15). But we still cannot use 15.
> To use 15 as a valid slot number in slot accelerators, we need to change 
> {{MIME_FIELD_SLOTNUM_UNKNOWN}} to 16 or -1, however it would need to change 
> some codes also (not only the number).
> This bug has been found while I was tackling TS-4313.
> https://github.com/apache/trafficserver/pull/542#discussion-diff-58226891



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (TS-4316) Slot accelerator doesn't effect under certain condition

2016-09-07 Thread Alan M. Carroll (JIRA)

[ 
https://issues.apache.org/jira/browse/TS-4316?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15471171#comment-15471171
 ] 

Alan M. Carroll commented on TS-4316:
-

I think this is interesting and should be pursued (specifically to check how 
often this actually happens) but it's clearly not going to be done for 7.0 and 
frankly isn't an incompatible change anyway. I have therefore moved this out to 
"sometime". 

> Slot accelerator doesn't effect under certain condition
> ---
>
> Key: TS-4316
> URL: https://issues.apache.org/jira/browse/TS-4316
> Project: Traffic Server
>  Issue Type: Bug
>  Components: MIME
>Reporter: Masakazu Kitajo
>Assignee: Alan M. Carroll
> Fix For: sometime
>
>
> Slot accelerators seem to not effect if the stored slot number is 14 or 15.
> This is because {{mime_hdr_set_accelerators_and_presence_bits()}} regards 
> slot number 14+ as "unknown" and stores MIME_FIELD_SLOTNUM_UNKNOWN(14) to an 
> accelerator, and it causes slower search. Although there is no critical 
> effect, it would decreases performance slightly.
> The numbers, 14 and 15, comes from constants below in MIME.h:
> {code}
> #define MIME_FIELD_SLOTNUM_BITS 4
> #define MIME_FIELD_SLOTNUM_MASK ((1 << MIME_FIELD_SLOTNUM_BITS) - 1)
> #define MIME_FIELD_SLOTNUM_MAX (MIME_FIELD_SLOTNUM_MASK - 1)
> #define MIME_FIELD_SLOTNUM_UNKNOWN MIME_FIELD_SLOTNUM_MAX
> {code}
> MIME_FIELD_SLOTNUM_MASK is 15.
> MIME_FIELD_SLOTNUM_MAX is 14.
> MIME_FIELD_SLOTNUM_UNKNOWN is 14 too.
> Though it still needs more careful confirmation, it seems we can simply 
> change {{MIME_FIELD_SLOTNUM_UNKNOWN}} to the value of 
> {{MIME_FIELD_SLOTNUM_MASK}} (15). But we still cannot use 15.
> To use 15 as a valid slot number in slot accelerators, we need to change 
> {{MIME_FIELD_SLOTNUM_UNKNOWN}} to 16 or -1, however it would need to change 
> some codes also (not only the number).
> This bug has been found while I was tackling TS-4313.
> https://github.com/apache/trafficserver/pull/542#discussion-diff-58226891



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (TS-4316) Slot accelerator doesn't effect under certain condition

2016-09-07 Thread Alan M. Carroll (JIRA)

[ 
https://issues.apache.org/jira/browse/TS-4316?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15471162#comment-15471162
 ] 

Alan M. Carroll commented on TS-4316:
-

Note the number of headers for which there is a slot accelerator is not 
affected by the width of the accelerator slot.  See {{HdrToken.h}} for the list 
(The {{MIME_SLOTID_}} defines). Adding (or not) the HTTP/2 pseudo headers to 
the WKS table won't make any difference for the slot accelerators. The real 
question is how often do we see a header with a defined accelerator slot ID 
that is past the 13th header? That might be interesting to check, if we extend 
[~ppenkov]'s header counting plugin.

> Slot accelerator doesn't effect under certain condition
> ---
>
> Key: TS-4316
> URL: https://issues.apache.org/jira/browse/TS-4316
> Project: Traffic Server
>  Issue Type: Bug
>  Components: MIME
>Reporter: Masakazu Kitajo
>Assignee: Alan M. Carroll
> Fix For: sometime
>
>
> Slot accelerators seem to not effect if the stored slot number is 14 or 15.
> This is because {{mime_hdr_set_accelerators_and_presence_bits()}} regards 
> slot number 14+ as "unknown" and stores MIME_FIELD_SLOTNUM_UNKNOWN(14) to an 
> accelerator, and it causes slower search. Although there is no critical 
> effect, it would decreases performance slightly.
> The numbers, 14 and 15, comes from constants below in MIME.h:
> {code}
> #define MIME_FIELD_SLOTNUM_BITS 4
> #define MIME_FIELD_SLOTNUM_MASK ((1 << MIME_FIELD_SLOTNUM_BITS) - 1)
> #define MIME_FIELD_SLOTNUM_MAX (MIME_FIELD_SLOTNUM_MASK - 1)
> #define MIME_FIELD_SLOTNUM_UNKNOWN MIME_FIELD_SLOTNUM_MAX
> {code}
> MIME_FIELD_SLOTNUM_MASK is 15.
> MIME_FIELD_SLOTNUM_MAX is 14.
> MIME_FIELD_SLOTNUM_UNKNOWN is 14 too.
> Though it still needs more careful confirmation, it seems we can simply 
> change {{MIME_FIELD_SLOTNUM_UNKNOWN}} to the value of 
> {{MIME_FIELD_SLOTNUM_MASK}} (15). But we still cannot use 15.
> To use 15 as a valid slot number in slot accelerators, we need to change 
> {{MIME_FIELD_SLOTNUM_UNKNOWN}} to 16 or -1, however it would need to change 
> some codes also (not only the number).
> This bug has been found while I was tackling TS-4313.
> https://github.com/apache/trafficserver/pull/542#discussion-diff-58226891



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (TS-4316) Slot accelerator doesn't effect under certain condition

2016-09-07 Thread Masakazu Kitajo (JIRA)

[ 
https://issues.apache.org/jira/browse/TS-4316?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15470810#comment-15470810
 ] 

Masakazu Kitajo commented on TS-4316:
-

{quote}
Those fields are still accessible, it just requires a linear search.
{quote}
Yes, that is the inefficiency what I wanted to say. Slot number 14 and 15 are 
unlucky slot numbers because we could have free slots that can access without 
linear search. Ideally, the two slots should be used after we used all slot 
0-13 of each slot IDs.

I'm not sure how much the expantion improves performance, but it could work 
because we use lots of headers nowdays and some of them should be added as 
WKSs. Such as H2 pseudo headers.

> Slot accelerator doesn't effect under certain condition
> ---
>
> Key: TS-4316
> URL: https://issues.apache.org/jira/browse/TS-4316
> Project: Traffic Server
>  Issue Type: Bug
>  Components: MIME
>Reporter: Masakazu Kitajo
>Assignee: Alan M. Carroll
> Fix For: 7.0.0
>
>
> Slot accelerators seem to not effect if the stored slot number is 14 or 15.
> This is because {{mime_hdr_set_accelerators_and_presence_bits()}} regards 
> slot number 14+ as "unknown" and stores MIME_FIELD_SLOTNUM_UNKNOWN(14) to an 
> accelerator, and it causes slower search. Although there is no critical 
> effect, it would decreases performance slightly.
> The numbers, 14 and 15, comes from constants below in MIME.h:
> {code}
> #define MIME_FIELD_SLOTNUM_BITS 4
> #define MIME_FIELD_SLOTNUM_MASK ((1 << MIME_FIELD_SLOTNUM_BITS) - 1)
> #define MIME_FIELD_SLOTNUM_MAX (MIME_FIELD_SLOTNUM_MASK - 1)
> #define MIME_FIELD_SLOTNUM_UNKNOWN MIME_FIELD_SLOTNUM_MAX
> {code}
> MIME_FIELD_SLOTNUM_MASK is 15.
> MIME_FIELD_SLOTNUM_MAX is 14.
> MIME_FIELD_SLOTNUM_UNKNOWN is 14 too.
> Though it still needs more careful confirmation, it seems we can simply 
> change {{MIME_FIELD_SLOTNUM_UNKNOWN}} to the value of 
> {{MIME_FIELD_SLOTNUM_MASK}} (15). But we still cannot use 15.
> To use 15 as a valid slot number in slot accelerators, we need to change 
> {{MIME_FIELD_SLOTNUM_UNKNOWN}} to 16 or -1, however it would need to change 
> some codes also (not only the number).
> This bug has been found while I was tackling TS-4313.
> https://github.com/apache/trafficserver/pull/542#discussion-diff-58226891



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (TS-4316) Slot accelerator doesn't effect under certain condition

2016-09-07 Thread Alan M. Carroll (JIRA)

[ 
https://issues.apache.org/jira/browse/TS-4316?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15470697#comment-15470697
 ] 

Alan M. Carroll commented on TS-4316:
-

Those fields are still accessible, it just requires a linear search.

If we were going to change things I'd go big and expand the slot indices to 8 
bits. That would double the accelerator space requirement but it wouldn't be 
too bad.

> Slot accelerator doesn't effect under certain condition
> ---
>
> Key: TS-4316
> URL: https://issues.apache.org/jira/browse/TS-4316
> Project: Traffic Server
>  Issue Type: Bug
>  Components: MIME
>Reporter: Masakazu Kitajo
>Assignee: Alan M. Carroll
> Fix For: 7.0.0
>
>
> Slot accelerators seem to not effect if the stored slot number is 14 or 15.
> This is because {{mime_hdr_set_accelerators_and_presence_bits()}} regards 
> slot number 14+ as "unknown" and stores MIME_FIELD_SLOTNUM_UNKNOWN(14) to an 
> accelerator, and it causes slower search. Although there is no critical 
> effect, it would decreases performance slightly.
> The numbers, 14 and 15, comes from constants below in MIME.h:
> {code}
> #define MIME_FIELD_SLOTNUM_BITS 4
> #define MIME_FIELD_SLOTNUM_MASK ((1 << MIME_FIELD_SLOTNUM_BITS) - 1)
> #define MIME_FIELD_SLOTNUM_MAX (MIME_FIELD_SLOTNUM_MASK - 1)
> #define MIME_FIELD_SLOTNUM_UNKNOWN MIME_FIELD_SLOTNUM_MAX
> {code}
> MIME_FIELD_SLOTNUM_MASK is 15.
> MIME_FIELD_SLOTNUM_MAX is 14.
> MIME_FIELD_SLOTNUM_UNKNOWN is 14 too.
> Though it still needs more careful confirmation, it seems we can simply 
> change {{MIME_FIELD_SLOTNUM_UNKNOWN}} to the value of 
> {{MIME_FIELD_SLOTNUM_MASK}} (15). But we still cannot use 15.
> To use 15 as a valid slot number in slot accelerators, we need to change 
> {{MIME_FIELD_SLOTNUM_UNKNOWN}} to 16 or -1, however it would need to change 
> some codes also (not only the number).
> This bug has been found while I was tackling TS-4313.
> https://github.com/apache/trafficserver/pull/542#discussion-diff-58226891



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (TS-4316) Slot accelerator doesn't effect under certain condition

2016-09-07 Thread Masakazu Kitajo (JIRA)

[ 
https://issues.apache.org/jira/browse/TS-4316?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15469832#comment-15469832
 ] 

Masakazu Kitajo commented on TS-4316:
-

I agree that changing {{MIME_FIELD_SLOTNUM_UNKNOWN}} to 16 would need quite a 
big changes. Also we might not be able to use 15 as well.

However, the problem is that slot 14 and 15 (the actual places, not the 
numbers) are used to store fields when we attach fields. But we cannot access 
there to get the fields because 14 and 15 have special meanings. So, if 14 and 
15 are invalid as normal slot numbers, I think we shouldn't store any fields to 
the slots and we should find the next really available slot.

> Slot accelerator doesn't effect under certain condition
> ---
>
> Key: TS-4316
> URL: https://issues.apache.org/jira/browse/TS-4316
> Project: Traffic Server
>  Issue Type: Bug
>  Components: MIME
>Reporter: Masakazu Kitajo
>Assignee: Alan M. Carroll
> Fix For: 7.0.0
>
>
> Slot accelerators seem to not effect if the stored slot number is 14 or 15.
> This is because {{mime_hdr_set_accelerators_and_presence_bits()}} regards 
> slot number 14+ as "unknown" and stores MIME_FIELD_SLOTNUM_UNKNOWN(14) to an 
> accelerator, and it causes slower search. Although there is no critical 
> effect, it would decreases performance slightly.
> The numbers, 14 and 15, comes from constants below in MIME.h:
> {code}
> #define MIME_FIELD_SLOTNUM_BITS 4
> #define MIME_FIELD_SLOTNUM_MASK ((1 << MIME_FIELD_SLOTNUM_BITS) - 1)
> #define MIME_FIELD_SLOTNUM_MAX (MIME_FIELD_SLOTNUM_MASK - 1)
> #define MIME_FIELD_SLOTNUM_UNKNOWN MIME_FIELD_SLOTNUM_MAX
> {code}
> MIME_FIELD_SLOTNUM_MASK is 15.
> MIME_FIELD_SLOTNUM_MAX is 14.
> MIME_FIELD_SLOTNUM_UNKNOWN is 14 too.
> Though it still needs more careful confirmation, it seems we can simply 
> change {{MIME_FIELD_SLOTNUM_UNKNOWN}} to the value of 
> {{MIME_FIELD_SLOTNUM_MASK}} (15). But we still cannot use 15.
> To use 15 as a valid slot number in slot accelerators, we need to change 
> {{MIME_FIELD_SLOTNUM_UNKNOWN}} to 16 or -1, however it would need to change 
> some codes also (not only the number).
> This bug has been found while I was tackling TS-4313.
> https://github.com/apache/trafficserver/pull/542#discussion-diff-58226891



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (TS-4316) Slot accelerator doesn't effect under certain condition

2016-09-06 Thread Alan M. Carroll (JIRA)

[ 
https://issues.apache.org/jira/browse/TS-4316?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15467486#comment-15467486
 ] 

Alan M. Carroll commented on TS-4316:
-

I don't see how changing {{MIME_FIELD_SLOTNUM_UNKNOWN}} to 16 will work, as 
there are only 4 bits in which to store the value (which of course is why 
{{MIME_FIELD_SLOTNUM_MASK}} is 0xF). In that context, -1 is simply a different 
notation for 15.

The slot accelerators are an array index by magic header constants (stored in 
the WKS data).  For a header in this group there is a reserved slot in the 
accelerators which always has some value. Looking at the code, it seems to me 
that {{MIME_FIELD_SLOTNUM_UNKNOWN}}, 0xE, means "the header is present but not 
in a known slot" which is quite different from 0xF which means "the header is 
not present". If you look at {{mime_hdr_init_accelerators_and_presence_bits}} 
you can it sets all the accelerator values to 0xF to indicate "not present".

To sum up, I don't think this can be changed without more substantial changes.



> Slot accelerator doesn't effect under certain condition
> ---
>
> Key: TS-4316
> URL: https://issues.apache.org/jira/browse/TS-4316
> Project: Traffic Server
>  Issue Type: Bug
>  Components: MIME
>Reporter: Masakazu Kitajo
>Assignee: Alan M. Carroll
> Fix For: 7.0.0
>
>
> Slot accelerators seem to not effect if the stored slot number is 14 or 15.
> This is because {{mime_hdr_set_accelerators_and_presence_bits()}} regards 
> slot number 14+ as "unknown" and stores MIME_FIELD_SLOTNUM_UNKNOWN(14) to an 
> accelerator, and it causes slower search. Although there is no critical 
> effect, it would decreases performance slightly.
> The numbers, 14 and 15, comes from constants below in MIME.h:
> {code}
> #define MIME_FIELD_SLOTNUM_BITS 4
> #define MIME_FIELD_SLOTNUM_MASK ((1 << MIME_FIELD_SLOTNUM_BITS) - 1)
> #define MIME_FIELD_SLOTNUM_MAX (MIME_FIELD_SLOTNUM_MASK - 1)
> #define MIME_FIELD_SLOTNUM_UNKNOWN MIME_FIELD_SLOTNUM_MAX
> {code}
> MIME_FIELD_SLOTNUM_MASK is 15.
> MIME_FIELD_SLOTNUM_MAX is 14.
> MIME_FIELD_SLOTNUM_UNKNOWN is 14 too.
> Though it still needs more careful confirmation, it seems we can simply 
> change {{MIME_FIELD_SLOTNUM_UNKNOWN}} to the value of 
> {{MIME_FIELD_SLOTNUM_MASK}} (15). But we still cannot use 15.
> To use 15 as a valid slot number in slot accelerators, we need to change 
> {{MIME_FIELD_SLOTNUM_UNKNOWN}} to 16 or -1, however it would need to change 
> some codes also (not only the number).
> This bug has been found while I was tackling TS-4313.
> https://github.com/apache/trafficserver/pull/542#discussion-diff-58226891



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)