RE: [PATCH v7] libgfortran: Replace mutex with rwlock

2023-12-14 Thread Zhu, Lipeng
On 2023/12/14 20:39, Jakub Jelinek wrote: > On Thu, Dec 14, 2023 at 01:29:01PM +0100, Thomas Schwinge wrote: >>> Sure, I will look into that. >>> >>> BTW, I didn’t have the PowerPC in hands, do you mind granting the access of >>> your >>> test environment to me to help reproduce the issue? >> >>

RE: [PATCH v7] libgfortran: Replace mutex with rwlock

2023-12-13 Thread Zhu, Lipeng
On 2023/12/14 4:52, Thomas Schwinge wrote: > Hi Lipeng! > > On 2023-12-12T02:05:26+0000, "Zhu, Lipeng" wrote: > > On 2023/12/12 1:45, H.J. Lu wrote: > >> On Sat, Dec 9, 2023 at 7:25 PM Zhu, Lipeng > wrote: > >> > On 2023/12/9 23:23, Jakub Jeli

RE: [PATCH v7] libgfortran: Replace mutex with rwlock

2023-12-11 Thread Zhu, Lipeng
On 2023/12/12 1:45, H.J. Lu wrote: > On Sat, Dec 9, 2023 at 7:25 PM Zhu, Lipeng wrote: > > > > On 2023/12/9 23:23, Jakub Jelinek wrote: > > > On Sat, Dec 09, 2023 at 10:39:45AM -0500, Lipeng Zhu wrote: > > > > This patch try to introduce the rwlock and split

RE: [PATCH v7] libgfortran: Replace mutex with rwlock

2023-12-09 Thread Zhu, Lipeng
On 2023/12/9 23:23, Jakub Jelinek wrote: > On Sat, Dec 09, 2023 at 10:39:45AM -0500, Lipeng Zhu wrote: > > This patch try to introduce the rwlock and split the read/write to > > unit_root tree and unit_cache with rwlock instead of the mutex to > > increase CPU efficiency. In the get_gfc_unit functi

RE: [PATCH v6] libgfortran: Replace mutex with rwlock

2023-12-09 Thread Zhu, Lipeng
On 2023/12/8 18:19, Jakub Jelinek wrote: > On Fri, Aug 18, 2023 at 11:18:19AM +0800, Zhu, Lipeng wrote: > > From: Lipeng Zhu > > > > This patch try to introduce the rwlock and split the read/write to > > unit_root tree and unit_cache with rwlock instead of the mutex to

RE: [PATCH v4] libgfortran: Replace mutex with rwlock

2023-12-06 Thread Zhu, Lipeng
> > [CCing Ian as libgcc maintainer] > > > > On Wed, 1 Nov 2023 10:14:37 +0000 > > "Zhu, Lipeng" wrote: > > > > > > > > > > > > Hi Lipeng, > > > > > > > > > > >>> Sure, as your com

RE: [PATCH v4] libgfortran: Replace mutex with rwlock

2023-11-23 Thread Zhu, Lipeng
> [CCing Ian as libgcc maintainer] > > On Wed, 1 Nov 2023 10:14:37 +0000 > "Zhu, Lipeng" wrote: > > > > > > > > > Hi Lipeng, > > > > > > > > >>> Sure, as your comments, in the patch V6, I added 3 test

RE: [PATCH v4] libgfortran: Replace mutex with rwlock

2023-11-01 Thread Zhu, Lipeng
> > > > Hi Lipeng, > > > > >>> Sure, as your comments, in the patch V6, I added 3 test cases with > > >>> OpenMP to test different cases in concurrency respectively: > > >>> 1. find and create unit very frequently to stress read lock and write > > >>> lock. > > >>> 2. only access the unit which ex

RE: [PATCH v4] libgfortran: Replace mutex with rwlock

2023-10-23 Thread Zhu, Lipeng
> > Hi Lipeng, > > >>> Sure, as your comments, in the patch V6, I added 3 test cases with > >>> OpenMP to test different cases in concurrency respectively: > >>> 1. find and create unit very frequently to stress read lock and write > >>> lock. > >>> 2. only access the unit which exist in cache t

RE: [PATCH v4] libgfortran: Replace mutex with rwlock

2023-10-22 Thread Zhu, Lipeng
> > > Hi Thomas, > > > > > > > > Hi Lipeng, > > > > > > > May I know any comment or concern on this patch, thanks for your > > > > time > > > > 😄 > > > > > > Thanks for your patience in getting this reviewed. > > > > > > A few remarks / questions. > > > > > > Which strategy is used in this impleme

RE: [PATCH v4] libgfortran: Replace mutex with rwlock

2023-09-14 Thread Zhu, Lipeng via Fortran
> Hi Thomas, > > > > > Hi Lipeng, > > > > > May I know any comment or concern on this patch, thanks for your > > > time > > > 😄 > > > > Thanks for your patience in getting this reviewed. > > > > A few remarks / questions. > > > > Which strategy is used in this implementation, read-preferring or >

[PATCH v6] libgfortran: Replace mutex with rwlock

2023-08-17 Thread Zhu, Lipeng via Fortran
ix typos and code formatter. v5 -> v6: Add unit tests. Reviewed-by: Hongjiu Lu Reviewed-by: Bernhard Reutner-Fischer Reviewed-by: Thomas Koenig Signed-off-by: Zhu, Lipeng --- libgcc/gthr-posix.h | 60 +++ libgfortran/io/async.c|

RE: [PATCH v4] libgfortran: Replace mutex with rwlock

2023-08-17 Thread Zhu, Lipeng via Fortran
Hi Thomas, > > Hi Lipeng, > > > May I know any comment or concern on this patch, thanks for your time > > 😄 > > Thanks for your patience in getting this reviewed. > > A few remarks / questions. > > Which strategy is used in this implementation, read-preferring or write- > preferring? And if

Re: [PATCH v4] libgfortran: Replace mutex with rwlock

2023-05-25 Thread Zhu, Lipeng via Fortran
On 1/1/1970 8:00 AM, Thomas Koenig wrote: Hi Lipeng, May I know any comment or concern on this patch, thanks for your time :) Thanks for your patience in getting this reviewed. A few remarks / questions. Which strategy is used in this implementation, read-preferring or write-preferring

Re: [PATCH v4] libgfortran: Replace mutex with rwlock

2023-05-22 Thread Zhu, Lipeng via Fortran
On 5/16/2023 3:08 PM, Zhu, Lipeng wrote: On 5/9/2023 10:32 AM, Zhu, Lipeng wrote: On 1/1/1970 8:00 AM, Bernhard Reutner-Fischer wrote: On Mon,  8 May 2023 17:44:43 +0800 Lipeng Zhu wrote: This patch try to introduce the rwlock and split the read/write to unit_root tree and unit_cache

Re: [PATCH v4] libgfortran: Replace mutex with rwlock

2023-05-16 Thread Zhu, Lipeng via Fortran
On 5/9/2023 10:32 AM, Zhu, Lipeng wrote: On 1/1/1970 8:00 AM, Bernhard Reutner-Fischer wrote: On Mon,  8 May 2023 17:44:43 +0800 Lipeng Zhu wrote: This patch try to introduce the rwlock and split the read/write to unit_root tree and unit_cache with rwlock instead of the mutex to

Re: [PATCH v4] libgfortran: Replace mutex with rwlock

2023-05-08 Thread Zhu, Lipeng via Fortran
On 1/1/1970 8:00 AM, Bernhard Reutner-Fischer wrote: On Mon, 8 May 2023 17:44:43 +0800 Lipeng Zhu wrote: This patch try to introduce the rwlock and split the read/write to unit_root tree and unit_cache with rwlock instead of the mutex to increase CPU efficiency. In the get_gfc_unit functio

Re: [PATCH v3] libgfortran: Replace mutex with rwlock

2023-05-08 Thread Zhu, Lipeng via Fortran
On 1/1/1970 8:00 AM, Bernhard Reutner-Fischer wrote: Hi! [please do not top-post] Sure, thanks for the reminder. On Thu, 20 Apr 2023 21:13:08 +0800 "Zhu, Lipeng" wrote: Hi Bernhard, Thanks for your questions and suggestions. The rwlock could allow multiple threads to have

Re: [PATCH v3] libgfortran: Replace mutex with rwlock

2023-04-20 Thread Zhu, Lipeng via Fortran
rt, while write part is not always necessary or most unlikely once the unit hit in cache; 3. We try to balance the implementation complexity and the performance gains that fit into current cases we observed. " Best Regards, Zhu, Lipeng On 1/1/1970 8:00 AM, Bernhard Reutner-Fischer wrote: On 19

RE: [PATCH v2] libgfortran: Replace mutex with rwlock

2023-01-05 Thread Zhu, Lipeng via Fortran
> > Hi Lipeng, > > > > > This patch try to introduce the rwlock and split the read/write to > > > unit_root tree and unit_cache with rwlock instead of the mutex to > > > increase CPU efficiency. In the get_gfc_unit function, the > > > percentage to step into the insert_unit function is around 3

RE: [PATCH v2] libgfortran: Replace mutex with rwlock

2022-12-28 Thread Zhu, Lipeng via Fortran
> Hi Lipeng, > > This patch try to introduce the rwlock and split the read/write to > > unit_root tree and unit_cache with rwlock instead of the mutex to > > increase CPU efficiency. In the get_gfc_unit function, the percentage > > to step into the insert_unit function is around 30%, in most >

[PATCH] libgfortran: Replace mutex with rwlock

2022-12-28 Thread Zhu, Lipeng via Fortran
> libstdc++ implements shared mutex with pthread_rwlock, which can > libstdc++ conflict > with the pthread_rwlock usage in libgcc. Lipeng, please limit the > pthread_rwlock usage in libgcc only when __cplusplus isn't defined. > > > -- > H.J. Thanks for suggestion, send a V2 patch. -- Lipeng