xpmem: fix mapping of attachment and segment

* Mapping attached part of segment is done at attach time instead of
  make time to work with runtimes (e.g. OpenMPI) xpmem_make-ing the
  entire user-space
* Mapping attached part of segment at attach time can be turned off by
  specifying xpmem_remote_on_demand in kernel argument
* Mapping attachment chooses appropriate page-sizes, i.e., largest
  allowed by memory range and segment page boundary

Fixes: a8696d8 "xpmem: Support large page attachment"
Change-Id: I44663865204036520e5f62fe22b9134ee4629f9b
This commit is contained in:
Masamichi Takagi
2020-05-12 13:17:46 +09:00
parent d370e9241f
commit a5fcc91656
43 changed files with 2876 additions and 285 deletions

View File

@@ -39,8 +39,8 @@ do
SEG_PGSIZE=`cat ${log_file} | awk '/OK/,/DONE/' | \
grep -o "large_page_allocation.*${SEG_ADDR}.*" | awk '{ print $5; }'`
XPMEM_ADDR=`grep xpmem_attachment_addr ${log_file} | awk '{ print $3; }'`
XPMEM_PGSIZE=`grep -o "xpmem_page_attach.*${XPMEM_ADDR}.*" ${log_file} | awk '{ print $5; }'`
XPMEM_ADDR=`grep xpmem_attachment_addr ${log_file} | awk '{ print $NF; }'`
XPMEM_PGSIZE=`grep -o "xpmem_page_attach.*${XPMEM_ADDR}.*" ${log_file} | awk '{ print $NF; }'`
if [ "${SEG_PGSIZE}" = "${EXPECT_PGSIZE}" ]; then
echo "** [ OK ] seg_addr ($SEG_ADDR) is allocated until xpmem_attach"
@@ -81,21 +81,24 @@ do
SEG_PGSIZE=`cat ${log_file} | awk '/OK/,/DONE/' | \
grep -o "large_page_allocation.*${SEG_ADDR}.*" | awk '{ print $5; }'`
XPMEM_ADDR=`grep xpmem_attachment_addr ${log_file} | awk '{ print $3; }'`
XPMEM_PGSIZE=`grep -o "xpmem_page_attach.*${XPMEM_ADDR}.*" ${log_file} | awk '{ print $5; }'`
XPMEM_ADDR=`grep xpmem_attachment_addr ${log_file} | awk '{ print $NF; }'`
XPMEM_PGSIZE=`grep -o "xpmem_page_attach.*${XPMEM_ADDR}.*" ${log_file} | awk '{ print $NF; }'`
if [ "${SEG_PGSIZE}" = "${EXPECT_PGSIZE}" ]; then
echo "** [ OK ] seg_addr ($SEG_ADDR) is allocated until xpmem_attach"
printf "** [ OK ] "
else
echo "** [ NG ] seg_addr ($SEG_ADDR) is NOT allocated until xpmem_attach"
printf "** [ NG ] "
let ng++
fi
echo "size of 1st page of segment at ${SEG_ADDR}: ${SEG_PGSIZE}, expected: ${EXPECT_PGSIZE}"
if [ "${XPMEM_PGSIZE}" = "${EXPECT_PGSIZE}" ]; then
echo "** [ OK ] xpmem_addr ($XPMEM_ADDR) is allocated using large pages"
printf "** [ OK ] "
else
echo "** [ NG ] xpmem_addr ($XPMEM_ADDR) is NOT allocated using large pages"
printf "** [ NG ] "
let ng++
fi
echo "size of 1st page of attachment at ${XPMEM_ADDR}: ${XPMEM_PGSIZE}, expected: ${EXPECT_PGSIZE}"
done
if [ ${ng} -eq 0 ]; then
echo "*** C${issue}T${tid}: PASSED"
@@ -116,8 +119,8 @@ ${IHKOSCTL} 0 kmsg >> ${log_file}
EXPECT_PGSIZE=`grep EXPECT_PAGE_SIZE ${log_file} | awk '{ print $2; }'`
XPMEM_ADDR=`grep xpmem_attachment_addr ${log_file} | awk '{ print $3; }'`
XPMEM_PGSIZE=`grep -o "xpmem_page_attach.*${XPMEM_ADDR}.*" ${log_file} | awk '{ print $5; }'`
XPMEM_ADDR=`grep xpmem_attachment_addr ${log_file} | awk '{ print $NF; }'`
XPMEM_PGSIZE=`grep -o "xpmem_page_attach.*${XPMEM_ADDR}.*" ${log_file} | awk '{ print $NF; }'`
if [ "${XPMEM_PGSIZE}" = "${EXPECT_PGSIZE}" ]; then
echo "** [ OK ] xpmem_addr ($XPMEM_ADDR) is allocated using small pages"
@@ -140,13 +143,13 @@ pgshift=${PGSHIFT_LIST[0]}
${IHKOSCTL} 0 clear_kmsg
log_file="./C${issue}T${tid}_${pgshift}.log"
echo pageshift: ${pgshift}
${MCEXEC} ./multi_vmr_xpmem ${pgshift} 1 > ${log_file}
${MCEXEC} ./multi_vmr_xpmem ${pgshift} 1 | tee ${log_file}
${IHKOSCTL} 0 kmsg >> ${log_file}
EXPECT_PGSIZE=`grep EXPECT_PAGE_SIZE ${log_file} | awk '{ print $2; }'`
XPMEM_ADDR=`grep xpmem_large ${log_file} | awk '{ print $3; }'`
XPMEM_PGSIZE=`grep -o "xpmem_page_attach.*${XPMEM_ADDR}.*" ${log_file} | awk '{ print $5; }'`
XPMEM_ADDR=`grep xpmem_large ${log_file} | awk '{ print $NF; }'`
XPMEM_PGSIZE=`grep -o "xpmem_page_attach.*${XPMEM_ADDR}.*" ${log_file} | awk '{ print $NF; }'`
if [ "${XPMEM_PGSIZE}" = "${EXPECT_PGSIZE}" ]; then
echo "** [ OK ] xpmem_addr ($XPMEM_ADDR) is allocated using large pages"
@@ -167,7 +170,7 @@ echo "*** C${issue}T${tid} start *******************************"
echo "** xpmem testsuite"
cwd=`pwd`
cd ${XPMEM_BUILD_DIR}/test
${cwd}/mc_run.sh
. ${cwd}/mc_run.sh
cd ${cwd}
# xpmem basic test