Skip to content

Commit

Permalink
remove all the legacy check related to 32GB KDS
Browse files Browse the repository at this point in the history
issue reported at #796.

The d1b3998 and related commit
removed KDS's length restriction to 32GB, by 64bit offset.
Thus, GpuCache's extra buffer is also not limited to 32GB, and
length validation checks are not needed any more.
  • Loading branch information
kaigai committed Jul 2, 2024
1 parent 4f87593 commit 5e7b418
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 30 deletions.
21 changes: 0 additions & 21 deletions src/gpu_cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -490,14 +490,6 @@ __parseSyncTriggerOptions(int elevel,
extra_sz += extra_sz / 4;
extra_sz += offsetof(kern_data_extra, data);
}
if (main_sz >= __KDS_LENGTH_LIMIT || extra_sz >= __KDS_LENGTH_LIMIT)
{
elog(elevel, "gpucache: max_num_rows = %ld consumes too much GPU device memory (main: %s, extra: %s), so we recommend to reduce 'max_num_rows' configuration",
max_num_rows,
format_bytesz(main_sz),
format_bytesz(extra_sz));
return false;
}

/*
* write back to the caller
Expand Down Expand Up @@ -1094,9 +1086,6 @@ __resetGpuCacheSharedState(GpuCacheSharedState *gc_sstate)
gc_sstate->redo_sync_pos = 0;
pthreadMutexUnlock(&gc_sstate->redo_mutex);

/* initial buffer size should be legal */
Assert(gc_sstate->kds_head.length <= __KDS_LENGTH_LIMIT &&
gc_sstate->kds_extra_sz <= __KDS_LENGTH_LIMIT);
/* make this GpuCache available again */
pg_atomic_write_u32(&gc_sstate->phase, GCACHE_PHASE__IS_EMPTY);
}
Expand Down Expand Up @@ -3509,16 +3498,6 @@ __gpucacheExecCompactionKernel(GpuCacheControlCommand *cmd,
if (kds_extra->usage > kds_extra->length)
{
gcache_extra_size = PAGE_ALIGN(kds_extra->usage * 5 / 4); /* 25% margin */
if (gcache_extra_size >= __KDS_LENGTH_LIMIT)
{
#if 1
fprintf(stderr,
"GpuCache (%s) extra buffer (%ldMB) exceeds the hard limit\n",
gc_sstate->table_name,
gcache_extra_size >> 20);
#endif
goto bailout;
}
cuMemFree(m_kds_extra);
m_kds_extra = 0UL;
goto retry;
Expand Down
9 changes: 0 additions & 9 deletions src/xpu_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -754,15 +754,6 @@ struct kern_data_extra
};
typedef struct kern_data_extra kern_data_extra;

/*
* MEMO: Support of 32GB KDS - KDS with row-, hash- and column-format
* internally uses 32bit offset value from the head or base address.
* We have assumption here - any objects pointed by the offset value
* is always aligned to MAXIMUM_ALIGNOF boundary (64bit).
* It means we can use 32bit offset to represent up to 32GB range (35bit).
*/
#define __KDS_LENGTH_LIMIT (1UL<<35) //deprecated

/* ----------------------------------------------------------------
*
* Definitions of HeapTuple/IndexTuple and related
Expand Down

0 comments on commit 5e7b418

Please sign in to comment.