Skip to content
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

Closed
wants to merge 3 commits into from

Conversation

wjwithagen
Copy link
Contributor

@wjwithagen wjwithagen commented Dec 16, 2018

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

  • References tracker ticket
  • Updates documentation if necessary
  • Includes tests for new functionality or reproducer for bug

Signed-off-by: Willem Jan Withagen <wjw@digiware.nl>
@wjwithagen wjwithagen added build/ops bluestore FreeBSD Modifications specific for (only) FreeBSD labels Dec 16, 2018
@wjwithagen wjwithagen force-pushed the wjw-wip-bluestore branch 2 times, most recently from 9111078 to c59bdd8 Compare December 16, 2018 23:16
@@ -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];
Copy link
Contributor

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;
Copy link
Contributor

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.

Copy link
Contributor

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)
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

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
Copy link
Contributor

@tchaikov tchaikov Dec 17, 2018

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;
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

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/os/bluestore/ceph-aio.h Outdated Show resolved Hide resolved
@@ -93,6 +93,9 @@
/* Defined if you have libaio */
#cmakedefine HAVE_LIBAIO

/* Defined if you have posix aio */
Copy link
Contributor

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>

Copy link
Contributor

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/

Copy link
Contributor

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:

  1. rename this file
  2. 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)
Copy link
Contributor

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)
Copy link
Contributor

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

  1. squash 544b4f7 into this commit
  2. 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 .

Copy link
Contributor Author

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.

@tchaikov
Copy link
Contributor

Free after the PR originally made by Alan Somers.

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>
Copy link
Contributor

@tchaikov tchaikov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wjwithagen

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)
Copy link
Contributor

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;
Copy link
Contributor

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>

Copy link
Contributor

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:

  1. rename this file
  2. add the POSIX AIO bits to ceph-aio.h.

and squash the POSIX AIO change into the bluestore enabling commit.

@wjwithagen
Copy link
Contributor Author

@tchaikov
No problem
I'm also fine with you cherry picking asomers/ceph@3bf3cbc first. It might require a bit of tweaking, 'cause I think it does not merge 100%.
So if you do that first, I'll submit new PR's on top of that to get the other stuff in..

@tchaikov
Copy link
Contributor

@wjwithagen #25608

@wjwithagen wjwithagen closed this Dec 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bluestore build/ops FreeBSD Modifications specific for (only) FreeBSD
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants