-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bluestore: Allow bluestore to build and test on FreeBSD. #25576
Conversation
Signed-off-by: Willem Jan Withagen <wjw@digiware.nl>
9111078
to
c59bdd8
Compare
src/os/bluestore/aio.cc
Outdated
@@ -56,20 +73,52 @@ int aio_queue_t::submit_batch(aio_iter begin, aio_iter end, | |||
|
|||
int aio_queue_t::get_next_completed(int timeout_ms, aio_t **paio, int max) | |||
{ | |||
io_event event[max]; | |||
#if defined(HAVE_LIBAIO) | |||
io_event events[max]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please avoid mixing refactoring changes along with the ones introducing features. in this case, please keep event
as it is. and create another PR commit for s/event/events/.
@@ -5926,7 +5926,7 @@ int BlueStore::add_new_bluefs_device(int id, const string& dev_path) | |||
|
|||
r = _mount_for_bluefs(); | |||
|
|||
int reserved; | |||
int reserved = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'd suggest move this change into a separated commit. and explain the reason what it fixes in the commit message.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wjwithagen could you share with us the error message regarding to "undefined value" ?
set(HAVE_LIBAIO OFF) | ||
set(HAVE_POSIXAIO ON) | ||
else() | ||
set(HAVE_LIBAIO OFF) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why shall we set them to OFF explicitly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tchaikov
Because in this case neither of the two versions are available. And lets make that explicit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wjwithagen the inquiry is not addressed. and i am inclined to remove them.
CMakeLists.txt
Outdated
set(HAVE_LIBAIO ${AIO_FOUND}) | ||
set(HAVE_POSIXAIO OFF) | ||
elseif(FREEBSD) | ||
# the AIO library is native in libc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMHO, it would be easier to digest if put this way:
POSIX AIO is integrated into FreeBSD kernel, and exposed by libc.
FreeBSD does not have libaio as GNU/Linux does. see also
#18357 (comment)
struct iocb iocb{}; // must be first element; see shenanigans in aio_queue_t | ||
#elif defined(HAVE_POSIXAIO) | ||
// static long aio_listio_max = -1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is this comment for? can we remove it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tchaikov
Copied it from Alan's woork, and I think it is working up to keeping track of the max items that can go into io_submit. And that needs to be read from sysctl, but not implemented yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wjwithagen could you please file a tracker or add a // TODO
instead? i can hardly deduce the intention of the author by reading this comment.
src/include/config-h.in.cmake
Outdated
@@ -93,6 +93,9 @@ | |||
/* Defined if you have libaio */ | |||
#cmakedefine HAVE_LIBAIO | |||
|
|||
/* Defined if you have posix aio */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/posix aio/POSIX AIO/
@@ -2,7 +2,15 @@ | |||
// vim: ts=8 sw=2 smarttab | |||
|
|||
#pragma once | |||
# include <libaio.h> | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might want to revise the topic of this commit to s/build/os/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wjwithagen this comment is not addressed.
and apparently this change is not merely renaming this file. please split this change into two commit:
- rename this file
- add the POSIX AIO bits to
ceph-aio.h
.
and squash the POSIX AIO change into the bluestore enabling commit.
@@ -258,8 +257,18 @@ endif() | |||
|
|||
option(WITH_BLUESTORE "Bluestore OSD backend" ON) | |||
if(WITH_BLUESTORE) | |||
find_package(aio) | |||
set(HAVE_LIBAIO ${AIO_FOUND}) | |||
if(LINUX) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the commit message is misleading, should s/HAVE_POSIX/HAVE_POSIXAIO/ .
@@ -19,7 +19,7 @@ | |||
|
|||
#include "BlockDevice.h" | |||
|
|||
#if defined(HAVE_LIBAIO) | |||
#if defined(HAVE_LIBAIO) || defined(HAVE_POSIXAIO) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this commit and 544b4f7 come from Alan Somers's branch at https://github.com/asomers/ceph/tree/bluestore_fbsd . i'd suggest
- squash 544b4f7 into this commit
- keep Alan's "Signed-off-by: Alan Somers asomers@gmail.com" in this commit and remove yours. because i don't think there is enough creative work from you after reading through this commit and asomers@3bf3cbc .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tchaikov
I don't claim originality for this work. Which is why I attribute the work to Alan's PR/branch. No problem with changing Signed-off.
i don't think @asomers has ever posted a PR for this. |
Introduce HAVE_POSIXAIO to allow FreeBSD aio to be used From: https://github.com/asomers/ceph/tree/bluestore_fbsd Ssubmited-by: Willem Jan Withagen <wjw@digiware.nl> Signed-off-by: Alan Somers <asomers@gmail.com>
Signed-off-by: Willem Jan Withagen <wjw@digiware.nl>
c59bdd8
to
70a32e0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the commit message and title of b3d992b is not accurate, also, i'd suggest not add "Submitted-by" line in the commit message, as every commit in Git has its own meta data attached to it. in this case, it reads
commit b3d992b11f2c02f058bd0ed7c69a7952b8c17b4d
Author: Willem Jan Withagen <wjw@digiware.nl>
Date: Sun Dec 16 18:08:31 2018 +0100
bluestore: Set build environment to build BLUESTORE
Introduce HAVE_POSIXAIO to allow FreeBSD aio to be used
From:
https://github.com/asomers/ceph/tree/bluestore_fbsd
Ssubmited-by: Willem Jan Withagen <wjw@digiware.nl>
Signed-off-by: Alan Somers <asomers@gmail.com>
actually, i am inclined to just cherry-pick asomers@3bf3cbc to preserve that commit's meta data.
set(HAVE_LIBAIO OFF) | ||
set(HAVE_POSIXAIO ON) | ||
else() | ||
set(HAVE_LIBAIO OFF) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wjwithagen the inquiry is not addressed. and i am inclined to remove them.
@@ -5926,7 +5926,7 @@ int BlueStore::add_new_bluefs_device(int id, const string& dev_path) | |||
|
|||
r = _mount_for_bluefs(); | |||
|
|||
int reserved; | |||
int reserved = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wjwithagen could you share with us the error message regarding to "undefined value" ?
@@ -2,7 +2,15 @@ | |||
// vim: ts=8 sw=2 smarttab | |||
|
|||
#pragma once | |||
# include <libaio.h> | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wjwithagen this comment is not addressed.
and apparently this change is not merely renaming this file. please split this change into two commit:
- rename this file
- add the POSIX AIO bits to
ceph-aio.h
.
and squash the POSIX AIO change into the bluestore enabling commit.
@tchaikov |
Free after the branch originally made by Alan Somers.
Introduce HAVE_POSIXAIO to allow FreeBSD aio to be used
From:
https://github.com/asomers/ceph/tree/bluestore_fbsd
Submited-by: Willem Jan Withagen wjw@digiware.nl
Signed-off-by: Alan Somers asomers@gmail.com