Received: from mail-ej1-f50.google.com (mail-ej1-f50.google.com [209.85.218.50]) by nld3-dev1.alpinelinux.org (Postfix) with ESMTPS id 535E8781127 for <~alpine/devel@lists.alpinelinux.org>; Tue, 21 Jun 2022 08:49:19 +0000 (UTC) Received: by mail-ej1-f50.google.com with SMTP id g25so25934087ejh.9 for <~alpine/devel@lists.alpinelinux.org>; Tue, 21 Jun 2022 01:49:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:cc :content-transfer-encoding; bh=D1nI0/Dmeh5XsKKHREFAc50yCxR/OVQJ8GqfrGRwQyo=; b=Zn/jFbctBl5cfiXiNeC5ouAUo0b561uaxECA+k6t5YglWwvoJW8cVOBRe49lG8+K3/ 0vbYu0hJ/8BZKLrtW0nZrpKPDe+cNWsP4Lj082lPMK+aJRTWlisMydhG1jU30HPYhrtN HEyBQ1p9Y8LubEBtZPgi127XMYVzvNJdVbPMutk8Y7/4a31UHYG+Imbke+/H98iOJfum +3OAjpciLTXNjPYktPqHZ6cSHPHdW4ArTydRFtxiLD9IbC1W0bWUzKPodMfFRlcObdmm SO1P2QPnBr9nOhSASit6suNBDJYfJI/bL7OlV0PugKMjnZSV7UpXJzTQVymR7gU775Wg f6Yw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:cc:content-transfer-encoding; bh=D1nI0/Dmeh5XsKKHREFAc50yCxR/OVQJ8GqfrGRwQyo=; b=6t6W3B1OYAzOqEs+PAAbsCPA+U/Y2Rn/pmVCtxwbIyZ0MtrdQI6fpjacxjEjkpBpdW eSfkPNNk4iT0TxhD3J71PusC/Lw0yJqqrAVlbMR9kfHQNFPK87msRzaIdN6JIN3iUKpd c2boqlFrH+CnAIQ1uVxBNEO4MutiCHxfUrot0SQMpSG9vAh1MMzvjHnuTkObSECCaEQp +Ybslgujn6YyLrvB+9zy4Q4vZHA4vAHXfr8WNw3wqC6NIwYzfJJ4SleU3CSnpeWY0MP4 KClP+bf6+5m1dL/SpIqVxYVYTrO0LdgH19n59QiwVAvkxOM1DRbFp9sIUrDSuJdSwXVB XFmQ== X-Gm-Message-State: AJIora+mgyl5Pr0SrahRLdK63cJ6Ln3Yqozdox2+2e1BrAptdkaaCwm5 KX90+A8SJWJ+WWYIEpe3rxyOKJaw8Wdkp7SICzKkQLSEZqE= X-Google-Smtp-Source: AGRyM1vYB5l9wFDWTafEjam9R3Cxz/iFJOeg+5VOGlO4BRniZtFdppeKp330FKT0F48ETWJkzxkPynYjWyBhGJITy2E= X-Received: by 2002:a17:907:8c0c:b0:718:d033:dec5 with SMTP id ta12-20020a1709078c0c00b00718d033dec5mr24421017ejc.744.1655801358755; Tue, 21 Jun 2022 01:49:18 -0700 (PDT) MIME-Version: 1.0 References: <20220621095653.71773d59@ncopa-desktop.lan> In-Reply-To: <20220621095653.71773d59@ncopa-desktop.lan> From: Tomas Kolda Date: Tue, 21 Jun 2022 10:49:07 +0200 Message-ID: Subject: Re: Native Alpine GLibc support (NEW) Cc: ~alpine/devel@lists.alpinelinux.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable =C3=BAt 21. 6. 2022 v 9:57 odes=C3=ADlatel Natanael Copa napsal: > > Do you have any smallish testcases where we can test this? > I do not have a small test. Synthetic applications does not give the best results. I am sure it is the issue as the only change is glibc vs. musl and kernel profiler point to pthread locking. There is a spin lock that wastes the CPU time in system space. Glibc have some heuristics to not get into the kernel that often (adaptive locking) which as a result brigs a lot of speed. JDK has no other dependency than C library. Anyway I will try to prepare some Java app that can show this. > > Would it be an idea to try fix the performance problems in musl libc > instead? It would probably be significantly less maintenance work long > term. > Yes this was one of my options. I was looking in glibc pthread implementation and it looks to me that they save some statistical features for adaptive locking in the structure. That as a result would require change of size of mutex object and that would require recompilation of all binaries. That is I think not acceptable. Performance tuning these low level functions is more like a magic and very sensitive (what helps one workload can break other). I am not sure how long glibc was tuning that so yes it looks like the best solution, but I am not sure if it is really doable under one year or so. We can ask MUSL community after I would be able to create a test. > > I believe someone did this some years ago, but stopped due to lack of > resources. > I definitely do not want to create new distro. It is really only about conditionally disabling some line here and there. I think it is like around 50 lines of changes in 10 packages to be able to compile 300 packages so far. I was actually surprised how easy it is now after I have compiled build-base, abuild and apk-tools, because now I can reuse it to build it itself again easily (new versions). I build in docker. > > We are already struggling with resources, full disks, many incoming > issues, feature requests, technical debt (lack of tests and/or > documentation) etc. I am personally feeling I'm almost able to keep my > head above the surface. > > So if this project can help solve our current issues, and contribute > with more resources for the project as a whole, then sure. But if this > is going to add more work for us long term, or even worse, someone do > the initial work and then dump the maintenance work on our laps after > there are a significant amount of users depending on it, then please no > thanks. > > I would rather spend the resources on fixing the issues with musl. > I completely agree and understand your view. Unfortunately I am not in a position to offer or fund the resources. Yes it can bring users and yes it can generate additional issues. My intention really was to have a pure Alpine built against glibc. It is a C library as a MUSL. Everything else is exactly same. I remember how much we were fighting with all variants of dependencies that are coming as glibc based, because many users are still on CentOS/Redhat/Debian/Ubuntu/etc. Glibc is mostly the blocker. That is also why I was not going to try to improve the MUSL as at the end I would hit the wall, because of another glibc based component. Anyway if there is some interest just let me know. Thanks, Tomas