# gentoo-sources-4.4.0[experimental] - what happened to BFQ?

## causality

I was wondering what happened to BFQ? 

I have the "experimental" USE flag enabled for package gentoo-sources.  I was previously using gentoo-sources-4.3.3 with BFQ added by that USE flag and enabled in the kernel .config file.  I was interested in continuing to use BFQ.

Then I upgrade to version gentoo-sources-4.4.0 (also with the "experimental" USE flag) and BFQ vanishes.  Once I ran "make oldconfig", BFQ options don't show up in the kernel .config file at all.  There is no option to enable or disable it.  I am now using CFQ because my only other options are deadline and no-op, which are both inferior choices on my rotational drives.

```
cat /sys/block/sda/queue/scheduler

noop [cfq] 
```

Strangely, I have searched through the gentoo-sources-4.4.0 Changelog and the genpatches page and there is no mention of it.  There is no entry anything like "BFQ removed for $REASON".  A search of these forums also found nothing.  It's just ... gone.  I vaguely remember something like this happening before, several versions ago, and just as mysteriously as it vanished it re-appeared.  Now it's gone again.

I don't wish to switch to ck-sources or pf-sources just to have BFQ.  I prefer the later versions and rock-solid stability I've always enjoyed with the gentoo-sources kernel.  Does anyone know what happened to it and how I might restore BFQ?

----------

## asturm

Often not every feature makes it into the .0 release, maybe it comes back with a revbump or .1.

----------

## causality

That does make sense and I appreciate your time spent clarifying it.  Thank you.

I guess this is to be expected with the .0 releases, until (if/when) BFQ makes it into the mainline vanilla kernel?

I do see why BFQ would be considered experimental.  It's non-trivial kernel code after all.  For me, with my rotational drives and mostly desktop (plus compile jobs) workload, it provides better throughput and superior responsiveness under load when compared to CFQ.  CFQ is not bad but for me BFQ was better.

The only oddity I encounter with BFQ is that occasionally, playing HD video (locally stored on the hard drive) with smplayer would "hiccup".  It was as though a frame or a few frames would skip.  This is different from the result of mplayer/mpv "framedrop" option, which is much less abrupt and tends not to come up anyway.  I would make a rough guess that for a moment the video stream was delayed.  This kind of workload doesn't require heavy I/O bandwidth but it does need an uninterrupted stream.  This only happens rarely when the system is under heavy load with emerge compile jobs.  The odd thing is, my media files are stored on one drive (/home/my_user/media), the main system on another (/), and the emerge compilations (/var) happen on a third drive.  These are separate physical devices, not separate partitions on a single drive.  So whatever this is, it's not caused by contention for a single overworked drive.  This does not happen to me when I use CFQ.

I knew going into it that an experimental feature might have an oddity like this.  Still I like BFQ because that "glitch" is extremely minor, everything else performs better, and I hope to continue testing it.

----------

## wrc1944

It's normal not to get the BFQ patch in right away on "experimental", especially when it's  one such as 4.4.3> 4.4.0. So far, it's always made it in when the 4.4.1 comes out.

You could always try applying the BFQ  (or any other previous) patch yourself- I used to do that myself with the ck and other versions of stuff I wanted to try and add to my kernels. 

Sometimes I could get them to easily apply, but since I'm no kernel hacker I would have problems.  I finally settled on the very nice gentoo-sources experimental, which always has the gcc opts as of late. It has all I want, and never gives me problems. and has great perfromance.

----------

## TigerJr

 *Quote:*   

> I don't wish to switch to ck-sources or pf-sources just to have BFQ. I prefer the later versions and rock-solid stability I've always enjoyed with the gentoo-sources kernel. Does anyone know what happened to it and how I might restore BFQ?

 

i use ck-sources but now ebuilds are too old. i think rock-solid stability and later versions that is quite different things.

I didn't know that BFQ scheduler included in mainstream kernel.

----------

## wrc1944

I don't think BFQ is actually in mainstream, but the Gentoo "experimental" patches maintainers add it along with the other ones.  

Apparently, BFQ is currently of a lower priority, thus it takes a little more time to get it included- at least that's my theory of why it is usually delayed  on a X.0 update, but then with subsequent X.1 .2 .3 etc. releases it always shows up. 

Don't know if it takes the BFQ devs some time to port over to the new kernel version, or the Gentoo experimental maintainers need to do an adaptation process of some kind for compatibility with other Gentoo kernel patches, or both.

----------

## TigerJr

 *wrc1944 wrote:*   

> I don't think BFQ is actually in mainstream, but the Gentoo "experimental" patches maintainers add it along with the other ones.  
> 
> Apparently, BFQ is currently of a lower priority, thus it takes a little more time to get it included- at least that's my theory of why it is usually delayed  on a X.0 update, but then with subsequent X.1 .2 .3 etc. releases it always shows up. 
> 
> Don't know if it takes the BFQ devs some time to port over to the new kernel version, or the Gentoo experimental maintainers need to do an adaptation process of some kind for compatibility with other Gentoo kernel patches, or both.

 

Than new kernel out and major number are changing( 4.0.x 4.1.x 4.2.x 4.3.x) it includes many new drivers and experimental feature, while minor number changing(4.1.1 4.1.2 ... 4.1.12 4.1.14 4.1.16) kernel includes only bugfix and stability patches, so now stable kernels are 3.4.110 3.10.95 3.18.25 - but this kernels without many needed drivers, filesystems and without many new functions.

i.e. in gentoo sys-kernel long time was xen-sources with xen virtualization patches, but now xen included in mainstream and doesn't needed anymore, but openvz-sources isn't good and his patches more experimental to include them in mainstream. So that why openvz have another sources with community patches.

----------

## wrc1944

Here's some more clarifications:

https://wiki.gentoo.org/wiki/Project:Kernel/Experimental

Since it was last updated Jan. 9, 2015, it refers to pretty old kernels, and for a long time there have been 

more patches included than just the BFQ and GCC opts they mention as their current patches.

----------

## TigerJr

 *wrc1944 wrote:*   

> Here's some more clarifications:
> 
> https://wiki.gentoo.org/wiki/Project:Kernel/Experimental
> 
> Since it was last updated Jan. 9, 2015, it refers to pretty old kernels, and for a long time there have been 
> ...

 

Does BFQ patches for ck-sources use GCC optimization? Or better use vanilla\gentoo-sources with experimental use flag?

----------

## wrc1944

BFQ and gcc-optimizations are two completely different patches.  I haven't used ck (Con Kolivas creates this one) for several years, but he revises it from kernel to kernel, and IIRC he had incuded BFQ in the past, but when I used ck I don't ever recall the gcc-opts patch being in there.

If you use gentoo-sources with USE="experimental" it will offer you the BFQ option (after gentoo devs get it in the new kernel) and gcc-opts kernel config options in make xconfig (if you have qt installed) or make gconfig if instead of qt you use the gtk toolkit in you gentoo installtion.  

When you configure kernels, using make xconfig (or gconfig) is so much easier/faster than menu config as it's all in a nice gui window where everything is readily available/visible/searchable with all the help explanations of what each kernel option means.  Just open a terminal like konsole, or the xfce4 terminal, go root, cd into the new kernel source directory, and type make xconfig, and the GUI window pops up.

Then you can then load in your old config from the file menu, edit in anything, start from scratch, or whatever you need, save it, quit xconfig, and finish compiling your new kernel in the terminal as usual. 

I keep a copy of my current config file in /usr/src where it's just one level up from when I'm in the new kernel's make xconfig window. Easy to load that way. Another great thing with the gui is that you can easily clean out/disable all the kernel modules or features your current hardware doesn't require or use, getting a very lean and quick kernel.

----------

## The Main Man

4.4.2 and still no BFQ

----------

## Perfect Gentleman

it is still possible to patch with own hands and fingers

----------

## wrc1944

As of 2016-01-22, BFQ-v7r10 for 4.4.0 (buggy) has just been replaced by BFQ-v7r11!

Here's some more quick links for info & patch files: 

http://algo.ing.unimo.it/people/paolo/disk_sched/

http://algo.ing.unimo.it/people/paolo/disk_sched/sources.php

https://bfq.teambelgium.net/

ftp://teambelgium.net/bfq/patches/4.4.0-v7r11        (right-click and "save link as" gets you each patch directly)

http://algo.ing.unimo.it/people/paolo/disk_sched/patches/4.4.0-v7r11/README.BFQ

However, even if all of the three bfq patches apply OK on the 4.4.x kernels, I suspect the gentoo experimental maintainers must be currently not including it for a good reason.  

If I have some time, I'll try applying it and see what happens.

EDIT:  I can confirm all three bfq patches apply cleanly to 4.4.0-gentoo-sources experimental. Will now compile and test out. 

```
gentoo-amd64 linux-4.4.0-gentoo # patch -p1 < 0001-block-cgroups-kconfig-build-bits-for-BFQ-v7r11-4.4.0.patch

patching file block/Kconfig.iosched

patching file block/Makefile

patching file include/linux/blkdev.h

gentoo-amd64 linux-4.4.0-gentoo # patch -p1 < 0002-block-introduce-the-BFQ-v7r11-I-O-sched-for-4.4.0.patch

patching file block/Kconfig.iosched

patching file block/bfq-cgroup.c

patching file block/bfq-ioc.c

patching file block/bfq-iosched.c

patching file block/bfq-sched.c

patching file block/bfq.h

gentoo-amd64 linux-4.4.0-gentoo # patch -p1 < 0003-block-bfq-add-Early-Queue-Merge-EQM-to-BFQ-v7r11-for.patch

patching file block/bfq-cgroup.c

patching file block/bfq-iosched.c

patching file block/bfq.h

gentoo-amd64 linux-4.4.0-gentoo # 
```

----------

## wrc1944

Just applied the BFQ-v7r11 patches to gentoo-sources-4.4.2 experimental on two Gentoo systems, and have had no problems patching, compiling, or running.

Wondering why BFQ isn't showning up in experimental patches yet- maybe because 4.4.x kernels are LTS kernels?

----------

## Juippisi

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b86bea363e85ab87e6cad830a4fa75e5273b0491

Its there now. Time to upgrade when nvidia-drivers follow up.

----------

