Re: [PATCH 17/18] mm, hugetlb: retry if we fail to allocate a hugepage with use_reserve

2013-08-09 Thread Joonsoo Kim
> I once attempted an approach involving an atomic counter of the number > of "in flight" hugepages, only retrying when it's non zero. Working > out a safe ordering for all the updates to get all the cases right > made my brain melt though, and I never got it working. I sent v2 few seconds

Re: [PATCH 17/18] mm, hugetlb: retry if we fail to allocate a hugepage with use_reserve

2013-08-09 Thread Joonsoo Kim
I once attempted an approach involving an atomic counter of the number of in flight hugepages, only retrying when it's non zero. Working out a safe ordering for all the updates to get all the cases right made my brain melt though, and I never got it working. I sent v2 few seconds before. My

Re: [PATCH 17/18] mm, hugetlb: retry if we fail to allocate a hugepage with use_reserve

2013-08-08 Thread David Gibson
On Wed, Aug 07, 2013 at 06:18:32PM +0900, Joonsoo Kim wrote: > On Tue, Aug 06, 2013 at 06:38:49PM -0700, Davidlohr Bueso wrote: > > On Wed, 2013-08-07 at 11:03 +1000, David Gibson wrote: > > > On Tue, Aug 06, 2013 at 05:18:44PM -0700, Davidlohr Bueso wrote: > > > > On Mon, 2013-08-05 at 16:36

Re: [PATCH 17/18] mm, hugetlb: retry if we fail to allocate a hugepage with use_reserve

2013-08-08 Thread David Gibson
On Wed, Aug 07, 2013 at 06:18:32PM +0900, Joonsoo Kim wrote: On Tue, Aug 06, 2013 at 06:38:49PM -0700, Davidlohr Bueso wrote: On Wed, 2013-08-07 at 11:03 +1000, David Gibson wrote: On Tue, Aug 06, 2013 at 05:18:44PM -0700, Davidlohr Bueso wrote: On Mon, 2013-08-05 at 16:36 +0900, Joonsoo

Re: [PATCH 17/18] mm, hugetlb: retry if we fail to allocate a hugepage with use_reserve

2013-08-07 Thread Joonsoo Kim
On Tue, Aug 06, 2013 at 06:38:49PM -0700, Davidlohr Bueso wrote: > On Wed, 2013-08-07 at 11:03 +1000, David Gibson wrote: > > On Tue, Aug 06, 2013 at 05:18:44PM -0700, Davidlohr Bueso wrote: > > > On Mon, 2013-08-05 at 16:36 +0900, Joonsoo Kim wrote: > > > > > Any mapping that doesn't use the

Re: [PATCH 17/18] mm, hugetlb: retry if we fail to allocate a hugepage with use_reserve

2013-08-07 Thread Joonsoo Kim
On Tue, Aug 06, 2013 at 06:38:49PM -0700, Davidlohr Bueso wrote: On Wed, 2013-08-07 at 11:03 +1000, David Gibson wrote: On Tue, Aug 06, 2013 at 05:18:44PM -0700, Davidlohr Bueso wrote: On Mon, 2013-08-05 at 16:36 +0900, Joonsoo Kim wrote: Any mapping that doesn't use the reserved pool,

Re: [PATCH 17/18] mm, hugetlb: retry if we fail to allocate a hugepage with use_reserve

2013-08-06 Thread Davidlohr Bueso
On Wed, 2013-08-07 at 11:03 +1000, David Gibson wrote: > On Tue, Aug 06, 2013 at 05:18:44PM -0700, Davidlohr Bueso wrote: > > On Mon, 2013-08-05 at 16:36 +0900, Joonsoo Kim wrote: > > > > Any mapping that doesn't use the reserved pool, not just > > > > MAP_NORESERVE. For example, if a process

Re: [PATCH 17/18] mm, hugetlb: retry if we fail to allocate a hugepage with use_reserve

2013-08-06 Thread David Gibson
On Tue, Aug 06, 2013 at 05:18:44PM -0700, Davidlohr Bueso wrote: > On Mon, 2013-08-05 at 16:36 +0900, Joonsoo Kim wrote: > > > Any mapping that doesn't use the reserved pool, not just > > > MAP_NORESERVE. For example, if a process makes a MAP_PRIVATE mapping, > > > then fork()s then the mapping

Re: [PATCH 17/18] mm, hugetlb: retry if we fail to allocate a hugepage with use_reserve

2013-08-06 Thread Davidlohr Bueso
On Mon, 2013-08-05 at 16:36 +0900, Joonsoo Kim wrote: > > Any mapping that doesn't use the reserved pool, not just > > MAP_NORESERVE. For example, if a process makes a MAP_PRIVATE mapping, > > then fork()s then the mapping is instantiated in the child, that will > > not draw from the reserved

Re: [PATCH 17/18] mm, hugetlb: retry if we fail to allocate a hugepage with use_reserve

2013-08-06 Thread Davidlohr Bueso
On Mon, 2013-08-05 at 16:36 +0900, Joonsoo Kim wrote: Any mapping that doesn't use the reserved pool, not just MAP_NORESERVE. For example, if a process makes a MAP_PRIVATE mapping, then fork()s then the mapping is instantiated in the child, that will not draw from the reserved pool.

Re: [PATCH 17/18] mm, hugetlb: retry if we fail to allocate a hugepage with use_reserve

2013-08-06 Thread David Gibson
On Tue, Aug 06, 2013 at 05:18:44PM -0700, Davidlohr Bueso wrote: On Mon, 2013-08-05 at 16:36 +0900, Joonsoo Kim wrote: Any mapping that doesn't use the reserved pool, not just MAP_NORESERVE. For example, if a process makes a MAP_PRIVATE mapping, then fork()s then the mapping is

Re: [PATCH 17/18] mm, hugetlb: retry if we fail to allocate a hugepage with use_reserve

2013-08-06 Thread Davidlohr Bueso
On Wed, 2013-08-07 at 11:03 +1000, David Gibson wrote: On Tue, Aug 06, 2013 at 05:18:44PM -0700, Davidlohr Bueso wrote: On Mon, 2013-08-05 at 16:36 +0900, Joonsoo Kim wrote: Any mapping that doesn't use the reserved pool, not just MAP_NORESERVE. For example, if a process makes a

Re: [PATCH 17/18] mm, hugetlb: retry if we fail to allocate a hugepage with use_reserve

2013-08-05 Thread Joonsoo Kim
> Any mapping that doesn't use the reserved pool, not just > MAP_NORESERVE. For example, if a process makes a MAP_PRIVATE mapping, > then fork()s then the mapping is instantiated in the child, that will > not draw from the reserved pool. > > > Should we ensure them to allocate the last hugepage?

Re: [PATCH 17/18] mm, hugetlb: retry if we fail to allocate a hugepage with use_reserve

2013-08-05 Thread Joonsoo Kim
Any mapping that doesn't use the reserved pool, not just MAP_NORESERVE. For example, if a process makes a MAP_PRIVATE mapping, then fork()s then the mapping is instantiated in the child, that will not draw from the reserved pool. Should we ensure them to allocate the last hugepage? They

Re: [PATCH 17/18] mm, hugetlb: retry if we fail to allocate a hugepage with use_reserve

2013-08-04 Thread David Gibson
On Wed, Jul 31, 2013 at 02:37:53PM +0900, Joonsoo Kim wrote: > Hello, David. > > On Mon, Jul 29, 2013 at 05:28:23PM +1000, David Gibson wrote: > > On Mon, Jul 29, 2013 at 02:32:08PM +0900, Joonsoo Kim wrote: > > > If parallel fault occur, we can fail to allocate a hugepage, > > > because many

Re: [PATCH 17/18] mm, hugetlb: retry if we fail to allocate a hugepage with use_reserve

2013-08-04 Thread David Gibson
On Wed, Jul 31, 2013 at 02:37:53PM +0900, Joonsoo Kim wrote: Hello, David. On Mon, Jul 29, 2013 at 05:28:23PM +1000, David Gibson wrote: On Mon, Jul 29, 2013 at 02:32:08PM +0900, Joonsoo Kim wrote: If parallel fault occur, we can fail to allocate a hugepage, because many threads

Re: [PATCH 17/18] mm, hugetlb: retry if we fail to allocate a hugepage with use_reserve

2013-07-30 Thread Joonsoo Kim
Hello, David. On Mon, Jul 29, 2013 at 05:28:23PM +1000, David Gibson wrote: > On Mon, Jul 29, 2013 at 02:32:08PM +0900, Joonsoo Kim wrote: > > If parallel fault occur, we can fail to allocate a hugepage, > > because many threads dequeue a hugepage to handle a fault of same address. > > This makes

Re: [PATCH 17/18] mm, hugetlb: retry if we fail to allocate a hugepage with use_reserve

2013-07-30 Thread Joonsoo Kim
Hello, David. On Mon, Jul 29, 2013 at 05:28:23PM +1000, David Gibson wrote: On Mon, Jul 29, 2013 at 02:32:08PM +0900, Joonsoo Kim wrote: If parallel fault occur, we can fail to allocate a hugepage, because many threads dequeue a hugepage to handle a fault of same address. This makes

Re: [PATCH 17/18] mm, hugetlb: retry if we fail to allocate a hugepage with use_reserve

2013-07-29 Thread David Gibson
On Mon, Jul 29, 2013 at 02:32:08PM +0900, Joonsoo Kim wrote: > If parallel fault occur, we can fail to allocate a hugepage, > because many threads dequeue a hugepage to handle a fault of same address. > This makes reserved pool shortage just for a little while and this cause > faulting thread who

Re: [PATCH 17/18] mm, hugetlb: retry if we fail to allocate a hugepage with use_reserve

2013-07-29 Thread David Gibson
On Mon, Jul 29, 2013 at 02:32:08PM +0900, Joonsoo Kim wrote: If parallel fault occur, we can fail to allocate a hugepage, because many threads dequeue a hugepage to handle a fault of same address. This makes reserved pool shortage just for a little while and this cause faulting thread who is

[PATCH 17/18] mm, hugetlb: retry if we fail to allocate a hugepage with use_reserve

2013-07-28 Thread Joonsoo Kim
If parallel fault occur, we can fail to allocate a hugepage, because many threads dequeue a hugepage to handle a fault of same address. This makes reserved pool shortage just for a little while and this cause faulting thread who is ensured to have enough reserved hugepages to get a SIGBUS signal.

[PATCH 17/18] mm, hugetlb: retry if we fail to allocate a hugepage with use_reserve

2013-07-28 Thread Joonsoo Kim
If parallel fault occur, we can fail to allocate a hugepage, because many threads dequeue a hugepage to handle a fault of same address. This makes reserved pool shortage just for a little while and this cause faulting thread who is ensured to have enough reserved hugepages to get a SIGBUS signal.