Re: DSA failed to allocate memory

2023-07-03 Thread Thomas Munro
Pushed. I wasn't sure it was worth keeping the test in the tree. It's here in the mailing list archives for future reference.

Re: DSA failed to allocate memory

2023-06-13 Thread Thomas Munro
On Mon, Feb 20, 2023 at 5:52 PM Thomas Munro wrote: > I'm wondering about this bit in rebin_segment(): > > + if (segment_map->header == NULL) > + return; > > Why would we be rebinning an uninitialised/unused segment? Answering my own question: because destroy_superblock() can

Re: DSA failed to allocate memory

2023-02-19 Thread Thomas Munro
On Fri, Jan 20, 2023 at 11:02 PM Thomas Munro wrote: > Yeah. I think the analysis looks good, but I'll do some testing next > week with the aim of getting it committed. Looks like it now needs > Meson changes, but I'll look after that as my penance. Here's an updated version that I'm

Re: DSA failed to allocate memory

2023-01-20 Thread Thomas Munro
On Fri, Jan 20, 2023 at 11:44 AM Tom Lane wrote: > Thomas Munro writes: > > Thanks for the report, and for working on the fix. Can you please > > create a commitfest entry (if you haven't already)? I plan to look at > > this soon, after the code freeze. > > Hi Thomas, are you still intending

Re: DSA failed to allocate memory

2023-01-19 Thread Tom Lane
Thomas Munro writes: > Thanks for the report, and for working on the fix. Can you please > create a commitfest entry (if you haven't already)? I plan to look at > this soon, after the code freeze. Hi Thomas, are you still intending to look at this DSA bug fix? It's been sitting idle for

Re: DSA failed to allocate memory

2022-04-06 Thread Dongming Liu
On Mon, Mar 28, 2022 at 3:53 PM Thomas Munro wrote: > Hi Dongming, > > Thanks for the report, and for working on the fix. Can you please > create a commitfest entry (if you haven't already)? I plan to look at > this soon, after the code freeze. I created a commitfest entry

Re: DSA failed to allocate memory

2022-03-28 Thread Thomas Munro
On Mon, Mar 28, 2022 at 8:14 PM Dongming Liu wrote: > On Fri, Mar 18, 2022 at 3:30 PM Dongming Liu wrote: >> 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

Re: DSA failed to allocate memory

2022-03-28 Thread Dongming Liu
On Fri, Mar 18, 2022 at 3:30 PM Dongming Liu 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

Re: DSA failed to allocate memory

2022-03-18 Thread Dongming Liu
> > 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,

Re: DSA failed to allocate memory

2022-01-24 Thread Robert Haas
On Mon, Jan 24, 2022 at 4:59 AM Dongming Liu wrote: > Maybe we can use one of the following methods to fix it: > 1. re-bin segment to suitable segment index when called dsa_free > 2. get_best_segment search all bins (2) is definitely the wrong idea. The comments say: /* * What is the lowest

DSA failed to allocate memory

2022-01-24 Thread Dongming Liu
Hi, I am using Dynamic shared memory areas(DSA) to manage some variable length shared memory, I've found that in some cases allocation fails even though there are enough contiguous pages. The steps to reproduce are as follows: 1. create a dsa area with a 1MB DSM segment 2. set its size limit to