[jira] [Commented] (TS-1742) Freelists to use 64bit version w/ Double Word Compare and Swap
[ https://issues.apache.org/jira/browse/TS-1742?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13598525#comment-13598525 ] Brian Geffon commented on TS-1742: -- Sounds like a no brainer, I'll get it removed with this commit. Thanks Weijin! > Freelists to use 64bit version w/ Double Word Compare and Swap > -- > > Key: TS-1742 > URL: https://issues.apache.org/jira/browse/TS-1742 > Project: Traffic Server > Issue Type: Improvement >Reporter: Brian Geffon >Assignee: Brian Geffon > Attachments: 128bit_cas.patch, 128bit_cas.patch.2 > > > So to those of you familiar with the freelists you know that it works this > way the head pointer uses the upper 16 bits for a version to prevent the ABA > problem. The big drawback to this is that it requires the following macros to > get at the pointer or the version: > {code} > #define FREELIST_POINTER(_x) ((void*)(intptr_t)(_x).data)<<16)>>16) | \ > (((~intptr_t)(_x).data)<<16>>63)-1))>>48)<<48))) // sign extend > #define FREELIST_VERSION(_x) (((intptr_t)(_x).data)>>48) > #define SET_FREELIST_POINTER_VERSION(_x,_p,_v) \ > (_x).data = intptr_t)(_p))&0xULL) | (((_v)&0xULL) > << 48)) > {code} > Additionally, since this only leaves 16 bits it limits the number of versions > you can have, well more and more x86_64 processors support DCAS (double word > compare and swap / 128bit CAS). This means that we can use 64bits for a > version which basically makes the versions unlimited but more importantly it > takes those macros above and simplifies them to: > {code} > #define FREELIST_POINTER(_x) (_x).s.pointer > #define FREELIST_VERSION(_x) (_x).s.version > #define SET_FREELIST_POINTER_VERSION(_x,_p,_v) \ > (_x).s.pointer = _p; (_x).s.version = _v > {code} > As you can imagine this will have a performance improvement, in my simple > tests I measured a performance improvement of around 6%. Unfortunately, I'm > not an expert with this stuff and I would really appreciate more community > feedback before I commit this patch. > Note: this only applies if you're not using a reclaimable freelist. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (TS-1742) Freelists to use 64bit version w/ Double Word Compare and Swap
[ https://issues.apache.org/jira/browse/TS-1742?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13598518#comment-13598518 ] weijin commented on TS-1742: Brian, John, I did a test, the size of assembly codes of ink_freelist_* function dropped 30%~40% if we removed the volatile in gcc version 4.4.1 > Freelists to use 64bit version w/ Double Word Compare and Swap > -- > > Key: TS-1742 > URL: https://issues.apache.org/jira/browse/TS-1742 > Project: Traffic Server > Issue Type: Improvement >Reporter: Brian Geffon >Assignee: Brian Geffon > Attachments: 128bit_cas.patch, 128bit_cas.patch.2 > > > So to those of you familiar with the freelists you know that it works this > way the head pointer uses the upper 16 bits for a version to prevent the ABA > problem. The big drawback to this is that it requires the following macros to > get at the pointer or the version: > {code} > #define FREELIST_POINTER(_x) ((void*)(intptr_t)(_x).data)<<16)>>16) | \ > (((~intptr_t)(_x).data)<<16>>63)-1))>>48)<<48))) // sign extend > #define FREELIST_VERSION(_x) (((intptr_t)(_x).data)>>48) > #define SET_FREELIST_POINTER_VERSION(_x,_p,_v) \ > (_x).data = intptr_t)(_p))&0xULL) | (((_v)&0xULL) > << 48)) > {code} > Additionally, since this only leaves 16 bits it limits the number of versions > you can have, well more and more x86_64 processors support DCAS (double word > compare and swap / 128bit CAS). This means that we can use 64bits for a > version which basically makes the versions unlimited but more importantly it > takes those macros above and simplifies them to: > {code} > #define FREELIST_POINTER(_x) (_x).s.pointer > #define FREELIST_VERSION(_x) (_x).s.version > #define SET_FREELIST_POINTER_VERSION(_x,_p,_v) \ > (_x).s.pointer = _p; (_x).s.version = _v > {code} > As you can imagine this will have a performance improvement, in my simple > tests I measured a performance improvement of around 6%. Unfortunately, I'm > not an expert with this stuff and I would really appreciate more community > feedback before I commit this patch. > Note: this only applies if you're not using a reclaimable freelist. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (TS-1551) ssl_multicert.config not reread with traffic_line -x
[ https://issues.apache.org/jira/browse/TS-1551?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Ethan Lai updated TS-1551: -- Attachment: sslcertlookup.cc.patch-3.2.4 This sslcertlookup.cc.patch-3.2.4 is patch for TS 3.2.4, please use it with your own risk. :) > ssl_multicert.config not reread with traffic_line -x > > > Key: TS-1551 > URL: https://issues.apache.org/jira/browse/TS-1551 > Project: Traffic Server > Issue Type: Bug > Components: Configuration, SSL >Affects Versions: 3.2.0 > Environment: RHEL 6 >Reporter: Ethan Lai >Assignee: James Peach >Priority: Minor > Fix For: 3.3.1 > > Attachments: sslcertlookup.cc.patch-3.2.0, > sslcertlookup.cc.patch-3.2.4, ssl_multicert_reconfigure.patch > > > Found that "ssl_multicert.config" is marked as modified, but not reread while > running traffic_line -x (Reread Config Files). > Just wondering is this expected behavior or not? > -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- > [Oct 26 09:59:45.018] Manager {0x7f3c6723d7e0} NOTE: > [LocalManager::startProxy] Launching ts process > [Oct 26 09:59:45.025] Manager {0x7f3c6723d7e0} NOTE: > [LocalManager::pollMgmtProcessServer] New process connecting fd '12' > [Oct 26 09:59:45.025] Manager {0x7f3c6723d7e0} NOTE: [Alarms::signalAlarm] > Server Process born > [Oct 26 09:59:46.066] Server {0x2b500a320680} DEBUG: (ssl) > ssl_multicert.config: /usr/local/etc/trafficserver/ssl_multicert.config > [Oct 26 09:59:46.094] Server {0x2b500a320680} DEBUG: (ssl) mapping > 'j1.free888.cloudns.biz' to certificate > /usr/local/etc/ats-cert/j1.free888.cloudns.biz-v2.pem > [Oct 26 09:59:46.096] Server {0x2b500a320680} NOTE: logging initialized[15], > logging_mode = 3 > [Oct 26 09:59:46.126] Server {0x2b500a320680} NOTE: traffic server running > $ sed -i 's/j1.free888.cloudns.biz-v2/j1.free888.cloudns.biz-v3/' > /usr/local/etc/trafficserver/ssl_multicert.config > $ `trafflic_line -x` > [Oct 26 09:59:59.954] Manager {0x7f3c5700} DEBUG: (rollback) > [Rollback::internalUpdate] Moving ssl_multicert.config from version 43 to > version 44 > [Oct 26 09:59:59.970] Manager {0x7f3c5700} NOTE: [fileUpdated] > ssl_multicert.config file has been modified > [Oct 26 09:59:59.970] Manager {0x7f3c5700} NOTE: User has changed config > file ssl_multicert.config > -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- > No "DEBUG: (ssl) mapping 'j1.free888.cloudns.biz' to certificate > /usr/local/etc/ats-cert/j1.free888.cloudns.biz-v3.pem" message found. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (TS-1742) Freelists to use 64bit version w/ Double Word Compare and Swap
[ https://issues.apache.org/jira/browse/TS-1742?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13598501#comment-13598501 ] John Plevyak commented on TS-1742: -- We can take it out because we do the loads manually for the cas. I always liked to use volatile as a marker that the variable was being accessed outside of a lock, but if it is causing a performance problem then we could convert the keyword into a comment: // Warning: this variable is read and written in multiple threads without a lock, use INK_QUEUE_LD to read safely. john > Freelists to use 64bit version w/ Double Word Compare and Swap > -- > > Key: TS-1742 > URL: https://issues.apache.org/jira/browse/TS-1742 > Project: Traffic Server > Issue Type: Improvement >Reporter: Brian Geffon >Assignee: Brian Geffon > Attachments: 128bit_cas.patch, 128bit_cas.patch.2 > > > So to those of you familiar with the freelists you know that it works this > way the head pointer uses the upper 16 bits for a version to prevent the ABA > problem. The big drawback to this is that it requires the following macros to > get at the pointer or the version: > {code} > #define FREELIST_POINTER(_x) ((void*)(intptr_t)(_x).data)<<16)>>16) | \ > (((~intptr_t)(_x).data)<<16>>63)-1))>>48)<<48))) // sign extend > #define FREELIST_VERSION(_x) (((intptr_t)(_x).data)>>48) > #define SET_FREELIST_POINTER_VERSION(_x,_p,_v) \ > (_x).data = intptr_t)(_p))&0xULL) | (((_v)&0xULL) > << 48)) > {code} > Additionally, since this only leaves 16 bits it limits the number of versions > you can have, well more and more x86_64 processors support DCAS (double word > compare and swap / 128bit CAS). This means that we can use 64bits for a > version which basically makes the versions unlimited but more importantly it > takes those macros above and simplifies them to: > {code} > #define FREELIST_POINTER(_x) (_x).s.pointer > #define FREELIST_VERSION(_x) (_x).s.version > #define SET_FREELIST_POINTER_VERSION(_x,_p,_v) \ > (_x).s.pointer = _p; (_x).s.version = _v > {code} > As you can imagine this will have a performance improvement, in my simple > tests I measured a performance improvement of around 6%. Unfortunately, I'm > not an expert with this stuff and I would really appreciate more community > feedback before I commit this patch. > Note: this only applies if you're not using a reclaimable freelist. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (TS-1742) Freelists to use 64bit version w/ Double Word Compare and Swap
[ https://issues.apache.org/jira/browse/TS-1742?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13598489#comment-13598489 ] Brian Geffon commented on TS-1742: -- hey weijin, you're saying that volatile is not required because we're doing the CAS anyway? The only issue with that is when you reload couldn't you possibly get stuck in an infinite loop of compare and swaps if the load was optimized away because there wasn't the volatile keyword? You guys definitely know the freelist stuff better than me, so if you think it's safe to take out I'll definitely do it. > Freelists to use 64bit version w/ Double Word Compare and Swap > -- > > Key: TS-1742 > URL: https://issues.apache.org/jira/browse/TS-1742 > Project: Traffic Server > Issue Type: Improvement >Reporter: Brian Geffon >Assignee: Brian Geffon > Attachments: 128bit_cas.patch, 128bit_cas.patch.2 > > > So to those of you familiar with the freelists you know that it works this > way the head pointer uses the upper 16 bits for a version to prevent the ABA > problem. The big drawback to this is that it requires the following macros to > get at the pointer or the version: > {code} > #define FREELIST_POINTER(_x) ((void*)(intptr_t)(_x).data)<<16)>>16) | \ > (((~intptr_t)(_x).data)<<16>>63)-1))>>48)<<48))) // sign extend > #define FREELIST_VERSION(_x) (((intptr_t)(_x).data)>>48) > #define SET_FREELIST_POINTER_VERSION(_x,_p,_v) \ > (_x).data = intptr_t)(_p))&0xULL) | (((_v)&0xULL) > << 48)) > {code} > Additionally, since this only leaves 16 bits it limits the number of versions > you can have, well more and more x86_64 processors support DCAS (double word > compare and swap / 128bit CAS). This means that we can use 64bits for a > version which basically makes the versions unlimited but more importantly it > takes those macros above and simplifies them to: > {code} > #define FREELIST_POINTER(_x) (_x).s.pointer > #define FREELIST_VERSION(_x) (_x).s.version > #define SET_FREELIST_POINTER_VERSION(_x,_p,_v) \ > (_x).s.pointer = _p; (_x).s.version = _v > {code} > As you can imagine this will have a performance improvement, in my simple > tests I measured a performance improvement of around 6%. Unfortunately, I'm > not an expert with this stuff and I would really appreciate more community > feedback before I commit this patch. > Note: this only applies if you're not using a reclaimable freelist. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (TS-1742) Freelists to use 64bit version w/ Double Word Compare and Swap
[ https://issues.apache.org/jira/browse/TS-1742?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13598486#comment-13598486 ] weijin commented on TS-1742: should we remove the volatile keyword in head_p structure ? It seems useless but generating slow assembly instructions. > Freelists to use 64bit version w/ Double Word Compare and Swap > -- > > Key: TS-1742 > URL: https://issues.apache.org/jira/browse/TS-1742 > Project: Traffic Server > Issue Type: Improvement >Reporter: Brian Geffon >Assignee: Brian Geffon > Attachments: 128bit_cas.patch, 128bit_cas.patch.2 > > > So to those of you familiar with the freelists you know that it works this > way the head pointer uses the upper 16 bits for a version to prevent the ABA > problem. The big drawback to this is that it requires the following macros to > get at the pointer or the version: > {code} > #define FREELIST_POINTER(_x) ((void*)(intptr_t)(_x).data)<<16)>>16) | \ > (((~intptr_t)(_x).data)<<16>>63)-1))>>48)<<48))) // sign extend > #define FREELIST_VERSION(_x) (((intptr_t)(_x).data)>>48) > #define SET_FREELIST_POINTER_VERSION(_x,_p,_v) \ > (_x).data = intptr_t)(_p))&0xULL) | (((_v)&0xULL) > << 48)) > {code} > Additionally, since this only leaves 16 bits it limits the number of versions > you can have, well more and more x86_64 processors support DCAS (double word > compare and swap / 128bit CAS). This means that we can use 64bits for a > version which basically makes the versions unlimited but more importantly it > takes those macros above and simplifies them to: > {code} > #define FREELIST_POINTER(_x) (_x).s.pointer > #define FREELIST_VERSION(_x) (_x).s.version > #define SET_FREELIST_POINTER_VERSION(_x,_p,_v) \ > (_x).s.pointer = _p; (_x).s.version = _v > {code} > As you can imagine this will have a performance improvement, in my simple > tests I measured a performance improvement of around 6%. Unfortunately, I'm > not an expert with this stuff and I would really appreciate more community > feedback before I commit this patch. > Note: this only applies if you're not using a reclaimable freelist. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (TS-1745) [PATCH] Fix Typos
[ https://issues.apache.org/jira/browse/TS-1745?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Benjamin Kerensa updated TS-1745: - Affects Version/s: 3.3.0 > [PATCH] Fix Typos > - > > Key: TS-1745 > URL: https://issues.apache.org/jira/browse/TS-1745 > Project: Traffic Server > Issue Type: Bug >Affects Versions: 3.3.0 >Reporter: Benjamin Kerensa > Attachments: 0001-Fix-Typos.patch > > -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (TS-1745) [PATCH] Fix Typos
[ https://issues.apache.org/jira/browse/TS-1745?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Benjamin Kerensa updated TS-1745: - Affects Version/s: 3.3.1 3.2.4 3.2.0 > [PATCH] Fix Typos > - > > Key: TS-1745 > URL: https://issues.apache.org/jira/browse/TS-1745 > Project: Traffic Server > Issue Type: Bug >Affects Versions: 3.3.1, 3.3.0, 3.2.4, 3.2.0 >Reporter: Benjamin Kerensa > Attachments: 0001-Fix-Typos.patch > > -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (TS-1745) [PATCH] Fix Typos
[ https://issues.apache.org/jira/browse/TS-1745?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Benjamin Kerensa updated TS-1745: - Attachment: 0001-Fix-Typos.patch > [PATCH] Fix Typos > - > > Key: TS-1745 > URL: https://issues.apache.org/jira/browse/TS-1745 > Project: Traffic Server > Issue Type: Bug >Reporter: Benjamin Kerensa > Attachments: 0001-Fix-Typos.patch > > -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Created] (TS-1745) [PATCH] Fix Typos
Benjamin Kerensa created TS-1745: Summary: [PATCH] Fix Typos Key: TS-1745 URL: https://issues.apache.org/jira/browse/TS-1745 Project: Traffic Server Issue Type: Bug Reporter: Benjamin Kerensa -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (TS-1627) Support requests with payload
[ https://issues.apache.org/jira/browse/TS-1627?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13598422#comment-13598422 ] Bryan Call commented on TS-1627: Uri - If you can rebase it with trunk that would be great. I finally have time to look at this bug and TS-871 (only have time on the weekends now). It looks like there are patches for both bugs. It sounds like this bug has the complete fix for allowing all request methods, except for TRACE, to have bodies. Correct me if I am wrong. Since I am up to speed on the patch and all the bugs, I should have time to run some test of my own this week if I can get an updated patch. I tried to apply it to trunk and it failed. > Support requests with payload > - > > Key: TS-1627 > URL: https://issues.apache.org/jira/browse/TS-1627 > Project: Traffic Server > Issue Type: Bug > Components: HTTP >Affects Versions: 3.3.0 >Reporter: Uri Shachar >Assignee: Bryan Call > Fix For: 3.3.2 > > Attachments: get_with_payload.patch, requests_with_content.patch > > > From what I understand from RFC 2616, these requests should be legal. ATS > currently accepts these requests, but drops the body when passing them onward > to the upstream. > Most discussion that I could find on the web say that this is legal -- > although what the upstream can actually do with the payload isn't clear > http://lists.w3.org/Archives/Public/ietf-http-wg/2006AprJun/0096.html > http://tech.groups.yahoo.com/group/rest-discuss/message/9957 > http://stackoverflow.com/questions/978061/http-get-with-request-body > http://dret.typepad.com/dretblog/2007/10/http-get-with-m.html -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Issue Comment Deleted] (TS-1742) Freelists to use 64bit version w/ Double Word Compare and Swap
[ https://issues.apache.org/jira/browse/TS-1742?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Igor Galić updated TS-1742: --- Comment: was deleted (was: why not simply use {{uint16_t}} (or {{uint32_t}}) then?) > Freelists to use 64bit version w/ Double Word Compare and Swap > -- > > Key: TS-1742 > URL: https://issues.apache.org/jira/browse/TS-1742 > Project: Traffic Server > Issue Type: Improvement >Reporter: Brian Geffon >Assignee: Brian Geffon > Attachments: 128bit_cas.patch, 128bit_cas.patch.2 > > > So to those of you familiar with the freelists you know that it works this > way the head pointer uses the upper 16 bits for a version to prevent the ABA > problem. The big drawback to this is that it requires the following macros to > get at the pointer or the version: > {code} > #define FREELIST_POINTER(_x) ((void*)(intptr_t)(_x).data)<<16)>>16) | \ > (((~intptr_t)(_x).data)<<16>>63)-1))>>48)<<48))) // sign extend > #define FREELIST_VERSION(_x) (((intptr_t)(_x).data)>>48) > #define SET_FREELIST_POINTER_VERSION(_x,_p,_v) \ > (_x).data = intptr_t)(_p))&0xULL) | (((_v)&0xULL) > << 48)) > {code} > Additionally, since this only leaves 16 bits it limits the number of versions > you can have, well more and more x86_64 processors support DCAS (double word > compare and swap / 128bit CAS). This means that we can use 64bits for a > version which basically makes the versions unlimited but more importantly it > takes those macros above and simplifies them to: > {code} > #define FREELIST_POINTER(_x) (_x).s.pointer > #define FREELIST_VERSION(_x) (_x).s.version > #define SET_FREELIST_POINTER_VERSION(_x,_p,_v) \ > (_x).s.pointer = _p; (_x).s.version = _v > {code} > As you can imagine this will have a performance improvement, in my simple > tests I measured a performance improvement of around 6%. Unfortunately, I'm > not an expert with this stuff and I would really appreciate more community > feedback before I commit this patch. > Note: this only applies if you're not using a reclaimable freelist. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (TS-1742) Freelists to use 64bit version w/ Double Word Compare and Swap
[ https://issues.apache.org/jira/browse/TS-1742?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13598390#comment-13598390 ] Igor Galić commented on TS-1742: why not simply use {{uint16_t}} (or >) then? > Freelists to use 64bit version w/ Double Word Compare and Swap > -- > > Key: TS-1742 > URL: https://issues.apache.org/jira/browse/TS-1742 > Project: Traffic Server > Issue Type: Improvement >Reporter: Brian Geffon >Assignee: Brian Geffon > Attachments: 128bit_cas.patch, 128bit_cas.patch.2 > > > So to those of you familiar with the freelists you know that it works this > way the head pointer uses the upper 16 bits for a version to prevent the ABA > problem. The big drawback to this is that it requires the following macros to > get at the pointer or the version: > {code} > #define FREELIST_POINTER(_x) ((void*)(intptr_t)(_x).data)<<16)>>16) | \ > (((~intptr_t)(_x).data)<<16>>63)-1))>>48)<<48))) // sign extend > #define FREELIST_VERSION(_x) (((intptr_t)(_x).data)>>48) > #define SET_FREELIST_POINTER_VERSION(_x,_p,_v) \ > (_x).data = intptr_t)(_p))&0xULL) | (((_v)&0xULL) > << 48)) > {code} > Additionally, since this only leaves 16 bits it limits the number of versions > you can have, well more and more x86_64 processors support DCAS (double word > compare and swap / 128bit CAS). This means that we can use 64bits for a > version which basically makes the versions unlimited but more importantly it > takes those macros above and simplifies them to: > {code} > #define FREELIST_POINTER(_x) (_x).s.pointer > #define FREELIST_VERSION(_x) (_x).s.version > #define SET_FREELIST_POINTER_VERSION(_x,_p,_v) \ > (_x).s.pointer = _p; (_x).s.version = _v > {code} > As you can imagine this will have a performance improvement, in my simple > tests I measured a performance improvement of around 6%. Unfortunately, I'm > not an expert with this stuff and I would really appreciate more community > feedback before I commit this patch. > Note: this only applies if you're not using a reclaimable freelist. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Comment Edited] (TS-1742) Freelists to use 64bit version w/ Double Word Compare and Swap
[ https://issues.apache.org/jira/browse/TS-1742?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13598390#comment-13598390 ] Igor Galić edited comment on TS-1742 at 3/10/13 9:34 PM: - why not simply use {{uint16_t}} (or {{uint32_t}}) then? was (Author: i.galic): why not simply use {{uint16_t}} (or >) then? > Freelists to use 64bit version w/ Double Word Compare and Swap > -- > > Key: TS-1742 > URL: https://issues.apache.org/jira/browse/TS-1742 > Project: Traffic Server > Issue Type: Improvement >Reporter: Brian Geffon >Assignee: Brian Geffon > Attachments: 128bit_cas.patch, 128bit_cas.patch.2 > > > So to those of you familiar with the freelists you know that it works this > way the head pointer uses the upper 16 bits for a version to prevent the ABA > problem. The big drawback to this is that it requires the following macros to > get at the pointer or the version: > {code} > #define FREELIST_POINTER(_x) ((void*)(intptr_t)(_x).data)<<16)>>16) | \ > (((~intptr_t)(_x).data)<<16>>63)-1))>>48)<<48))) // sign extend > #define FREELIST_VERSION(_x) (((intptr_t)(_x).data)>>48) > #define SET_FREELIST_POINTER_VERSION(_x,_p,_v) \ > (_x).data = intptr_t)(_p))&0xULL) | (((_v)&0xULL) > << 48)) > {code} > Additionally, since this only leaves 16 bits it limits the number of versions > you can have, well more and more x86_64 processors support DCAS (double word > compare and swap / 128bit CAS). This means that we can use 64bits for a > version which basically makes the versions unlimited but more importantly it > takes those macros above and simplifies them to: > {code} > #define FREELIST_POINTER(_x) (_x).s.pointer > #define FREELIST_VERSION(_x) (_x).s.version > #define SET_FREELIST_POINTER_VERSION(_x,_p,_v) \ > (_x).s.pointer = _p; (_x).s.version = _v > {code} > As you can imagine this will have a performance improvement, in my simple > tests I measured a performance improvement of around 6%. Unfortunately, I'm > not an expert with this stuff and I would really appreciate more community > feedback before I commit this patch. > Note: this only applies if you're not using a reclaimable freelist. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (TS-1742) Freelists to use 64bit version w/ Double Word Compare and Swap
[ https://issues.apache.org/jira/browse/TS-1742?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13598350#comment-13598350 ] John Plevyak commented on TS-1742: -- Looks good. I might consider adding an ink_debug_assert that the type_size for the freelist now be at least 16 bytes when this is enabled. > Freelists to use 64bit version w/ Double Word Compare and Swap > -- > > Key: TS-1742 > URL: https://issues.apache.org/jira/browse/TS-1742 > Project: Traffic Server > Issue Type: Improvement >Reporter: Brian Geffon >Assignee: Brian Geffon > Attachments: 128bit_cas.patch, 128bit_cas.patch.2 > > > So to those of you familiar with the freelists you know that it works this > way the head pointer uses the upper 16 bits for a version to prevent the ABA > problem. The big drawback to this is that it requires the following macros to > get at the pointer or the version: > {code} > #define FREELIST_POINTER(_x) ((void*)(intptr_t)(_x).data)<<16)>>16) | \ > (((~intptr_t)(_x).data)<<16>>63)-1))>>48)<<48))) // sign extend > #define FREELIST_VERSION(_x) (((intptr_t)(_x).data)>>48) > #define SET_FREELIST_POINTER_VERSION(_x,_p,_v) \ > (_x).data = intptr_t)(_p))&0xULL) | (((_v)&0xULL) > << 48)) > {code} > Additionally, since this only leaves 16 bits it limits the number of versions > you can have, well more and more x86_64 processors support DCAS (double word > compare and swap / 128bit CAS). This means that we can use 64bits for a > version which basically makes the versions unlimited but more importantly it > takes those macros above and simplifies them to: > {code} > #define FREELIST_POINTER(_x) (_x).s.pointer > #define FREELIST_VERSION(_x) (_x).s.version > #define SET_FREELIST_POINTER_VERSION(_x,_p,_v) \ > (_x).s.pointer = _p; (_x).s.version = _v > {code} > As you can imagine this will have a performance improvement, in my simple > tests I measured a performance improvement of around 6%. Unfortunately, I'm > not an expert with this stuff and I would really appreciate more community > feedback before I commit this patch. > Note: this only applies if you're not using a reclaimable freelist. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira