all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Mark H Weaver <mhw@netris.org>
To: Danny Milosavljevic <dannym@scratchpost.org>
Cc: guix-devel <guix-devel@gnu.org>
Subject: Re: heads-up: Haskell updates
Date: Thu, 15 Feb 2018 03:41:33 -0500	[thread overview]
Message-ID: <87a7waodaa.fsf@netris.org> (raw)
In-Reply-To: <20180214234721.4e9fe198@scratchpost.org> (Danny Milosavljevic's message of "Wed, 14 Feb 2018 23:47:21 +0100")

Hi Danny,

Danny Milosavljevic <dannym@scratchpost.org> writes:

> Hi Mark,
> Hi Ricardo,
>
> On Wed, 14 Feb 2018 20:39:12 +0100
> Ricardo Wurmus <rekado@elephly.net> wrote:
>
>> Nor do I see this message:
>> 
>>     ghc-pkg: unable to decommit memory: Invalid argument
>
> Which Linux kernel version does this run on?

Last I knew, Hydra's x86 build slaves were all running kernels older
than 4.5, but I'm not sure if that's still the case.

>> I don’t know what this message means, but the messages about requiring a
>
> If there's large address space support [1], ghc 8 does its own allocation in a
> 1 TB address space.  That means it has to tell the kernel when it doesn't
> need some chunk anymore - otherwise you're gonna run out of memory.
>
> It does that using madvise(2).  There's two ways it tries to do that:
>
> (1) MADV_FREE: Signals that "I don't need that range at all anymore".
> It usually means Linux will mark those pages free.
>
> (2) MADV_DONTNEED: Signals that "I don't need that range in the NEAR FUTURE".
> It usually means Linux will swap those pages out.
>
> MADV_FREE was added in Linux 4.5.  Haskell uses a #ifdef to detect it.

Given that it's using #ifdef to detect this, I'd expect the result to
depend only on the _headers_ being used to compile, and not the actual
kernel running the build.  Is that right?  If so, this doesn't explain
why it works for Ricardo but not for Andreas and Hydra.

Note that on our 'master' branch we are using Linux-libre-4.4 kernel
headers, but on 'core-updates' we're using 4.9 kernel headers.

The recently created evaluation 109913 on Hydra is for core-updates with
the recent Haskell changes included.  It'll be interesting to see if the
same failure happens there.  I gave the 'ghc-resourcet' jobs a high
priority.  Here are the 'ghc-resourcet' jobs for evaluation 109913:

  https://hydra.gnu.org/build/2497604  (x86_64)
  https://hydra.gnu.org/build/2498874  (i686)

> Newer glibc (such as the one in core-updates) unconditionally define MADV_FREE
> to prevent programs from depending on a specific Linux kernel in this way [2].
>
> There's a patch to ghc that falls back to (2) if (1) doesn't work:
>
> https://git.haskell.org/ghc.git/commitdiff/6576bf83cdf4eac05eb88a24aa934a736c91e3da
>
> ... but ghc 8.0.2 which we have on core-updates doesn't use it.
> It uses either MADV_FREE or MADV_DONTNEED, determined at compile time.
>
> So if the Linux kernel is < 4.5 that's gonna end very badly.

Thanks for the detailed analysis!

I suppose if one reads the error message literally:

  Control/Monad/Trans/Resource/Internal.hs:302:10: error:
      • Could not deduce (MonadBase IO (Strict.StateT s m))
          arising from the superclasses of an instance declaration
        from the context: MonadResource m
          bound by the instance declaration
          at Control/Monad/Trans/Resource/Internal.hs:302:10-63
      • In the instance declaration for
          ‘MonadResource (Strict.StateT s m)’

"Could not deduce" might be interpreted to include the case where we
failed for lack of sufficient memory.  They might have written the code
to catch any error at all, including out of memory errors, and report
the failure with this error message.

What do you think?

      Mark

  reply	other threads:[~2018-02-15  8:42 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-13 12:48 heads-up: Haskell updates Ricardo Wurmus
2018-02-14 14:20 ` Ludovic Courtès
2018-02-14 16:46   ` Ricardo Wurmus
2018-02-14 18:46 ` Mark H Weaver
2018-02-14 19:19   ` Ricardo Wurmus
2018-02-14 19:39     ` Ricardo Wurmus
2018-02-14 19:44       ` Ricardo Wurmus
2018-02-14 21:23       ` Mark H Weaver
2018-02-14 21:39         ` Andreas Enge
2018-02-14 22:42           ` Ricardo Wurmus
2018-02-14 22:47       ` Danny Milosavljevic
2018-02-15  8:41         ` Mark H Weaver [this message]
2018-02-15  9:17           ` Ricardo Wurmus
2018-02-15 10:38             ` Mark H Weaver
2018-02-15 14:02             ` Timothy Sample
2018-02-15 15:05               ` Ricardo Wurmus
2018-02-17 12:50               ` Ricardo Wurmus
2018-02-17 13:04                 ` Ricardo Wurmus
2018-02-17 15:18                   ` Andreas Enge
2018-02-17 16:11                     ` Ricardo Wurmus
2018-02-17 20:00                       ` Mark H Weaver
2018-02-17 20:24                         ` core-updates, last call? Leo Famulari
2018-02-17 23:16                           ` Ricardo Wurmus
2018-02-18 21:45                             ` Pjotr Prins
2018-02-18 22:44                               ` Ricardo Wurmus
2018-02-18 20:42                       ` heads-up: Haskell updates Chris Marusich
2018-02-15 10:29           ` Mark H Weaver
2018-02-15 11:04           ` Danny Milosavljevic
2018-02-15 11:08             ` Danny Milosavljevic
2018-02-15 11:12             ` Andreas Enge
2018-02-15 15:44             ` Ricardo Wurmus
2018-02-15 17:03               ` Danny Milosavljevic
2018-02-15 17:46                 ` Leo Famulari
2018-02-15 18:12                 ` Mark H Weaver
2018-02-16 15:26                 ` Danny Milosavljevic
2018-02-16 16:31                   ` Marius Bakke
2018-02-16 17:43                     ` Ricardo Wurmus
2018-02-16 18:12                       ` Marius Bakke
2018-02-16 18:29                         ` Leo Famulari
2018-02-16 22:14                           ` Mark H Weaver
2018-02-16 18:15                       ` Mark H Weaver
2018-02-17  0:33                         ` Ricardo Wurmus
2018-02-17 12:11                       ` Oleg Pykhalov
2018-02-17 12:18                         ` Ricardo Wurmus
2018-02-17 12:55                           ` Oleg Pykhalov
2018-02-17 13:00                             ` Ricardo Wurmus
2018-02-17 13:38                               ` Timothy Sample
2018-02-17 14:42                                 ` Ricardo Wurmus
2018-02-17 16:04                                   ` Timothy Sample
2018-02-17 23:22                                     ` Ricardo Wurmus
2018-02-17 15:51                               ` Oleg Pykhalov
2018-02-17 19:48               ` Mark H Weaver
2018-02-17 19:54             ` Mark H Weaver
2018-02-17 21:51               ` Danny Milosavljevic
2018-02-17 22:32                 ` Timothy Sample

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87a7waodaa.fsf@netris.org \
    --to=mhw@netris.org \
    --cc=dannym@scratchpost.org \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.