[GHC] #13714: Guard pages instead of Heap/Stack limit checks in Cmm

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[GHC] #13714: Guard pages instead of Heap/Stack limit checks in Cmm

GHC - devs mailing list
#13714: Guard pages instead of Heap/Stack limit checks in Cmm
-------------------------------------+-------------------------------------
           Reporter:  varosi         |             Owner:  (none)
               Type:  feature        |            Status:  new
  request                            |
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  8.0.2
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 Recently I have debugged a small program and I saw that there are a lot of
 Heap/Stack limit checks on function entrances
 ([https://ghc.haskell.org/trac/ghc/browser/ghc/rts/HeapStackCheck.cmm]).
 This is not cheap and introduce more branch mispredictions and
 instructions.
 What you think if we use guard OS pages (that trigger exceptions when
 someone try to read/write on them) around Stack and Heap? Stack and Heap
 sizes should be aligned on page size (usually 4K) and with sizes that fits
 4K pages. We could handle such exceptions so we could do GC if needed.
 This trick is usually found in some memory managers for finding out-of-
 bounds bugs.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13714>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

Re: [GHC] #13714: Guard pages instead of Heap/Stack limit checks in Cmm

GHC - devs mailing list
#13714: Guard pages instead of Heap/Stack limit checks in Cmm
-------------------------------------+-------------------------------------
        Reporter:  varosi            |                Owner:  (none)
            Type:  feature request   |               Status:  closed
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.0.2
      Resolution:  duplicate         |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #8703             |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------
Changes (by dfeuer):

 * status:  new => closed
 * resolution:   => duplicate
 * related:   => #8703


Comment:

 This is a duplicate of #8703. I am curious as to whether this would be
 easier under Linux now that we pre-allocate a contiguous heap.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13714#comment:1>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

Re: [GHC] #13714: Guard pages instead of Heap/Stack limit checks in Cmm

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#13714: Guard pages instead of Heap/Stack limit checks in Cmm
-------------------------------------+-------------------------------------
        Reporter:  varosi            |                Owner:  (none)
            Type:  feature request   |               Status:  closed
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.0.2
      Resolution:  duplicate         |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #8703             |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by varosi):

 I'll write to other issue. Thanks!

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13714#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

Re: [GHC] #13714: Guard pages instead of Heap/Stack limit checks in Cmm

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#13714: Guard pages instead of Heap/Stack limit checks in Cmm
-------------------------------------+-------------------------------------
        Reporter:  varosi            |                Owner:  (none)
            Type:  feature request   |               Status:  closed
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.0.2
      Resolution:  duplicate         |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #8703             |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by varosi):

 We could just try first to realloc to extend memory blocks.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13714#comment:3>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets