Re: DSA failed to allocate memory

Поиск
Список
Период
Сортировка
От Dongming Liu
Тема Re: DSA failed to allocate memory
Дата
Msg-id CAL1p7e_451-=m7uL+P2feaFkOOUTyGdsrC+EJKoZUWUEFPfP7g@mail.gmail.com
обсуждение исходный текст
Ответ на Re: DSA failed to allocate memory  (Dongming Liu <ldming101@gmail.com>)
Ответы Re: DSA failed to allocate memory  (Thomas Munro <thomas.munro@gmail.com>)
Список pgsql-hackers
On Fri, Mar 18, 2022 at 3:30 PM Dongming Liu <ldming101@gmail.com> wrote:
So it's OK for a segment to be in a bin that suggests that it has more
consecutive free pages than it really does. But it's NOT ok for a
segment to be in a bin that suggests it has fewer consecutive pages
than it really does. If dsa_free() is putting things back into the
wrong place, that's what we need to fix.

I'm trying to move segments into appropriate bins in dsa_free().
In 0001-Re-bin-segment-when-dsa-memory-is-freed.patch, I extract 
the re-bin segment logic into a separate function called rebin_segment,
call it to move the segment to the appropriate bin when dsa memory is
freed. Otherwise, when allocating memory, due to the segment with
enough contiguous pages is in a smaller bin, a suitable segment
may not be found to allocate memory.

Fot test, I port the test_dsa patch from [1] and add an OOM case to
test memory allocation until OOM, free and then allocation, compare 
the number of allocated memory before and after.

Any thoughts?



Fix rebin_segment not working on in-place dsa.

--
Best Regards,
Dongming
Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Amit Kapila
Дата:
Сообщение: Re: logical replication empty transactions
Следующее
От: Amit Langote
Дата:
Сообщение: Re: generic plans and "initial" pruning