Bug#892295: jemalloc: Please add support for new architecture "riscv64" (RISC-V 64 bits little-endian)

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Bug#892295: jemalloc: Please add support for new architecture "riscv64" (RISC-V 64 bits little-endian)

Manuel A. Fernandez Montecelo
Source: jemalloc
Version: 3.6.0-11
Severity: normal
Tags: patch upstream fixed-upstream
User: [hidden email]
Usertags: riscv64
Forwarded: https://github.com/jemalloc/jemalloc/pull/1081

Hello,

We need support in this package for RISC-V, to bootstrap the riscv64
architecture.

Patches have been submitted upstream months ago, targetting development
versions:

  https://github.com/jemalloc/jemalloc/commit/749caf14ae73a9ab1c48e538a8af09addbb35ee7

  (the file was named differently before, I didn't bother to get the VCS history
  to chase all commits, but it's clear enough).

Since we're still including older versions in unstable (and even experimental),
and in Debian we can get by by defining LG_QUANTUM in d/rules, instead of
patching the upstream source code I propose a patch for debian/rules instead,
attached.

It would be great if you could include it as a patch and release a new version
for unstable.

If we can help by NMUing the package or anything else, please let me/us know.


Thanks and cheers.
--
Manuel A. Fernandez Montecelo <[hidden email]>

jemalloc-riscv64-support.patch (399 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Bug#892295: jemalloc: Please add support for new architecture "riscv64" (RISC-V 64 bits little-endian)

Faidon Liambotis-2
reopen 892295
tags 892295 + help - fixed-upstream patch
thanks

Hi Manuel,

On Wed, Mar 07, 2018 at 10:44:25PM +0100, Manuel A. Fernandez Montecelo wrote:

> We need support in this package for RISC-V, to bootstrap the riscv64
> architecture.
>
> Patches have been submitted upstream months ago, targetting development
> versions:
>
>   https://github.com/jemalloc/jemalloc/commit/749caf14ae73a9ab1c48e538a8af09addbb35ee7
>
>   (the file was named differently before, I didn't bother to get the VCS history
>   to chase all commits, but it's clear enough).
>
> Since we're still including older versions in unstable (and even experimental),
> and in Debian we can get by by defining LG_QUANTUM in d/rules, instead of
> patching the upstream source code I propose a patch for debian/rules instead,
> attached.
>
> It would be great if you could include it as a patch and release a new version
> for unstable.

I uploaded 5.1.0-2 to unstable moments ago, which includes the
aforementioned commit.

Unfortunately, it seems like the build fails due to atomics-related
complications, which judging from similar bug reports, could be fixed by
passing -pthread instead of -lpthread. I filed this upstream[1] and that
seemed like a good idea to them.

1: https://github.com/jemalloc/jemalloc/issues/1401

I then experimented with building with that option on a riscv64
qemu-user-static container locally, but I came across random issues when
running the test suite, like some allocation issues, or processes
hanging etc. The build with the same option on amd64 seems to have
worked fine. I wonder if this has something to do with jemalloc or my
(weirdly emulated) environment, bug regardless... I would love your
help, if you have a spare moment :)

Regards,
Faidon

Reply | Threaded
Open this post in threaded view
|

Bug#892295: jemalloc: Please add support for new architecture "riscv64" (RISC-V 64 bits little-endian)

Manuel A. Fernandez Montecelo-2
Hi!

2019-01-07 23:15 Faidon Liambotis:

>reopen 892295
>tags 892295 + help - fixed-upstream patch
>thanks
>
>[...]
>
>I uploaded 5.1.0-2 to unstable moments ago, which includes the
>aforementioned commit.
>
>Unfortunately, it seems like the build fails due to atomics-related
>complications, which judging from similar bug reports, could be fixed by
>passing -pthread instead of -lpthread. I filed this upstream[1] and that
>seemed like a good idea to them.
>
>1: https://github.com/jemalloc/jemalloc/issues/1401
>
>I then experimented with building with that option on a riscv64
>qemu-user-static container locally, but I came across random issues when
>running the test suite, like some allocation issues, or processes
>hanging etc. The build with the same option on amd64 seems to have
>worked fine. I wonder if this has something to do with jemalloc or my
>(weirdly emulated) environment, bug regardless... I would love your
>help, if you have a spare moment :)
First of all, thanks for taking care.

I am not sure what are your modifications, but I tried with the
patch/debdiff attached, compared to 5.1.0-1 (-2 is/was not yet in
snapshot or deb.debian.org) and everything went fine:

  Test suite summary: pass: 43/52, skip: 9/52, fail: 0/52

More info about the build, which I'll proceed to upload to unreleased:

  Build Architecture: riscv64
  Build Type: full
  Build-Space: 763036
  Build-Time: 2051
  Distribution: unreleased
  Host Architecture: riscv64
  Install-Time: 40
  Job: .../jemalloc/jemalloc_5.1.0-1+0.riscv64.1.dsc
  Machine Architecture: riscv64
  Package: jemalloc
  Package-Time: 2122
  Source-Version: 5.1.0-1+0.riscv64.1
  Space: 763036
  Status: successful
  Version: 5.1.0-1+0.riscv64.1

This is on real hardware, I trust that it will also work fine in the
buildds (qemu-system), but if not we can take another look.

Not sure if the patch is correct or it's better to fix it in another
way, I hope that you or upstream can figure that out, or if not we can
iterate over it and try different things.

Hope that helps.  Thanks again!

--
Manuel A. Fernandez Montecelo <[hidden email]>

riscv64-support.patch (1K) Download Attachment
jemalloc_5.1.0-1+0.riscv64.1.debdiff (2K) Download Attachment
jemalloc_5.1.0-1+0.riscv64.1_riscv64.build.xz (29K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Bug#892295: jemalloc: Please add support for new architecture "riscv64" (RISC-V 64 bits little-endian)

Faidon Liambotis-2
On Tue, Jan 08, 2019 at 12:35:28AM +0100, Manuel A. Fernandez Montecelo wrote:
> I am not sure what are your modifications, but I tried with the
> patch/debdiff attached, compared to 5.1.0-1 (-2 is/was not yet in
> snapshot or deb.debian.org) and everything went fine:
>
>  Test suite summary: pass: 43/52, skip: 9/52, fail: 0/52

Hm, interesting! Thanks for testing this -- I'm not sure what went wrong
in my setup. Probably something related to qemu-user-static...

So, I pushed this patch to the master branch in the salsa repo, and also
pushed this upstream: https://github.com/jemalloc/jemalloc/pull/1402

5.1.0-2 was uploaded to unstable shortly before my previous email, so it
should start appearing on mirrors etc. soon. This upload involves a
transition, so I'll hold any changes until this plays out.

I'll take of this once that's done, but I'm curious to hear what
upstream will say in the meantime :)

Thanks!
Faidon

Reply | Threaded
Open this post in threaded view
|

Bug#892295: jemalloc: Please add support for new architecture "riscv64" (RISC-V 64 bits little-endian)

Manuel A. Fernandez Montecelo-2
2019-01-08 03:11 Faidon Liambotis:
>On Tue, Jan 08, 2019 at 12:35:28AM +0100, Manuel A. Fernandez Montecelo wrote:
>> I am not sure what are your modifications, but I tried with the
>> patch/debdiff attached, compared to 5.1.0-1 (-2 is/was not yet in
>> snapshot or deb.debian.org) and everything went fine:
>>
>>  Test suite summary: pass: 43/52, skip: 9/52, fail: 0/52
>
>Hm, interesting! Thanks for testing this -- I'm not sure what went wrong
>in my setup. Probably something related to qemu-user-static...

Yeah, qemu-user is unreliable for some stuff, specially
"delicate"/"sophisticated" low-level libraries.

That's why we use the much slower qemu-system for buildds.


>So, I pushed this patch to the master branch in the salsa repo, and also
>pushed this upstream: https://github.com/jemalloc/jemalloc/pull/1402
>
>5.1.0-2 was uploaded to unstable shortly before my previous email, so it
>should start appearing on mirrors etc. soon. This upload involves a
>transition, so I'll hold any changes until this plays out.

What kind of transition?  The soname didn't change, I think?  (not for
-1 at least).

If it indeed breaks stuff, maybe I made a mistake to upload the new
version to "unreleased" for this port.


>I'll take of this once that's done, but I'm curious to hear what
>upstream will say in the meantime :)

Good, thanks to you!


--
Manuel A. Fernandez Montecelo <[hidden email]>

Reply | Threaded
Open this post in threaded view
|

Bug#892295: jemalloc: Please add support for new architecture "riscv64" (RISC-V 64 bits little-endian)

Manuel A. Fernandez Montecelo-2
Em qua, 9 de jan de 2019 às 23:03, Manuel A. Fernandez Montecelo
<[hidden email]> escreveu:
> 2019-01-08 03:11 Faidon Liambotis:
> >
> >5.1.0-2 was uploaded to unstable shortly before my previous email, so it
> >should start appearing on mirrors etc. soon. This upload involves a
> >transition, so I'll hold any changes until this plays out.
>
> What kind of transition?  The soname didn't change, I think?  (not for
> -1 at least).

Ah I see that now that I was wrong and now it's libjemalloc2, I
somehow missed it :)

--
Manuel A. Fernandez Montecelo <[hidden email]>