-mm merge plans for 2.6.23
Subsystems (10)
Re: containers (was Re: -mm merge plans for 2.6.23)
In reply to Srivatsa VaddagiriQuoted 2 lines · Srivatsa Vaddagiri
The other alternative is to hook up group scheduler with user-id's (again only for 2.6.23).
could you just try this and send an as simple patch as possible? This is actually something that non-container people would be interested in as well. (btw., if this goes into 2.6.23 then we cannot possibly turn it off in 2.6.24, so it must be sane - but per UID task groups are certainly sane, the only question is how to configure the per-UID weight after bootup. [the default after-bootup should be something along the lines of 'same weight for all users, a bit more for root'.]) This would make it possible for users to test that thing. (it would also help X-heavy workloads.)
Ingo
Re: containers (was Re: -mm merge plans for 2.6.23)
Quoted 8 lines · Ingo Molnar
Quoted 2 lines · Srivatsa Vaddagiri
The other alternative is to hook up group scheduler with user-id's (again only for 2.6.23).
could you just try this and send an as simple patch as possible? This is actually something that non-container people would be interested in as well.
Note that interfacing with container infrastructure doesn't preclude the possibility of doing fair-user scheduling (that a normal university server or desktop user would want). All that is needed is a daemon which listens for uid change events from kernel (using process-event connector) and moves the task (whose uid is changing) to an appropriate container for that user. Primitive source for such a daemon is attached.
Quoted 1 line
(btw., if this goes into 2.6.23 then we cannot possibly turn it off in 2.6.24,
The fact that we will have two interface for group scheduler in 2.6.24 is what worries me a bit (one user-id based and other container based). We would need some mechanism for admin to choose only one interface (and not both together, otherwise the group definitions may conflict), which doesn't sound very clean to me.
Ideally I would have liked to hook onto only container infrastructure and let user-space decide grouping policy (whether user-id based or something else).
Hmm ..would it help if I maintain a patch outside the mainline which turns on fair-user scheduling in 2.6.23-rcX? Folks will have to apply that patch on top of 2.6.23-rcX to use and test fair-user scheduling.
In 2.6.24, when container infrastructure goes in, people can get fair-user scheduling off-the-shelf by simply starting the daemon attached at bootup/initrd time.
Or would you rather prefer that I add user-id based interface permanently and in 2.6.24 introduce a compile/run-time switch for admin to select one of the two interfaces (user-id based or container-based)?
Quoted 3 lines
so it must be sane - but per UID task groups are
certainly sane, the only question is how to configure the per-UID weight after bootup.
Yeah ..the container based infrastructure allows for configuring such things very easily using a fs-based interface. In the absence of that, we either provide some /proc interface or settle for the non-configurable default that you mention below.
Quoted 4 lines
[the default after-bootup should be something along the
lines of 'same weight for all users, a bit more for root'.]) This would make it possible for users to test that thing. (it would also help X-heavy workloads.)
Signature · 2 lines
Regards, vatsa
/*
* cpuctl_group_changer.c
*
* Used to change the group of running tasks to the correct
* uid container.
*
* Copyright IBM Corporation, 2007
* Author: Dhaval Giani <[email protected]>
* Derived from test_cn_proc.c by Matt Helsley
* Original copyright notice follows
*
* Copyright (C) Matt Helsley, IBM Corp. 2005
* Derived from fcctl.c by Guillaume Thouvenin
* Original copyright notice follows:
*
* Copyright (C) 2005 BULL SA.
* Written by Guillaume Thouvenin <[email protected]> *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <string.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/param.h>
#include <linux/connector.h>
#include <linux/netlink.h>
#include "linux/cn_proc.h"
#include <errno.h>
#include <signal.h>
#include <setjmp.h>
#define SEND_MESSAGE_LEN (NLMSG_LENGTH(sizeof(struct cn_msg) + \
sizeof(enum proc_cn_mcast_op)))
#define RECV_MESSAGE_LEN (NLMSG_LENGTH(sizeof(struct cn_msg) + \
sizeof(struct proc_event)))
#define SEND_MESSAGE_SIZE (NLMSG_SPACE(SEND_MESSAGE_LEN))
#define RECV_MESSAGE_SIZE (NLMSG_SPACE(RECV_MESSAGE_LEN))
#define max(x,y) ((y)<(x)?(x):(y))
#define min(x,y) ((y)>(x)?(x):(y))
#define BUFF_SIZE (max(max(SEND_MESSAGE_SIZE, RECV_MESSAGE_SIZE), 1024)) #define MIN_RECV_SIZE (min(SEND_MESSAGE_SIZE, RECV_MESSAGE_SIZE))
#define PROC_CN_MCAST_LISTEN (1)
#define PROC_CN_MCAST_IGNORE (2)
/*
* SIGINT causes the program to exit gracefully
* this could happen any time after the LISTEN message has
* been sent
*/
#define INTR_SIG SIGINT
sigjmp_buf g_jmp;
char cpuctl_fs_path[MAXPATHLEN];
void handle_intr (int signum)
{
siglongjmp(g_jmp, signum);
}static inline void itos(int i, char* str)
{
sprintf(str, "%d", i);
}int set_notify_release(int val)
{
FILE *f;
f = fopen("notify_on_release", "r+");
fprintf(f, "%d\n", val);
fclose(f);
return 0;
}int add_task_pid(int pid)
{
FILE *f;
f = fopen("tasks", "a");
fprintf(f, "%d\n", pid);
fclose(f);
return 0;
}int set_value(char* file, char *str)
{
FILE *f;
f=fopen(file, "w");
fprintf(f, "%s", str);
fclose(f);
return 0;
}int change_group(int pid, int uid)
{
char str[100];
int ret;
ret = chdir(cpuctl_fs_path);
itos(uid, str);
ret = mkdir(str, 0777);
if (ret == -1) {
/*
* If the folder already exists, then it is alright. anything
* else should be killed
*/
if (errno != EEXIST) {
perror("mkdir");
return -1;
}
}
ret = chdir(str);
if (ret == -1) {
/*Again, i am just quitting the program!*/
perror("chdir");
return -1;
}
/*If using cpusets set cpus and mems*
*
* set_value("cpus","0");
* set_value("mems","0");
*/
set_notify_release(1);
add_task_pid(pid);
return 0;
}int handle_msg (struct cn_msg *cn_hdr)
{
struct proc_event *ev;
int ret;
ev = (struct proc_event*)cn_hdr->data;
switch(ev->what){
case PROC_EVENT_UID:
printf("UID Change happening\n");
printf("UID = %d\tPID=%d\n", ev->event_data.id.e.euid,
ev->event_data.id.process_pid);
ret = change_group(ev->event_data.id.process_pid,
ev->event_data.id.r.ruid);
break;
case PROC_EVENT_FORK:
case PROC_EVENT_EXEC:
case PROC_EVENT_EXIT:
default:
break;
}
return ret;
}
int main(int argc, char **argv)
{
int sk_nl;
int err;
struct sockaddr_nl my_nla, kern_nla, from_nla;
socklen_t from_nla_len;
char buff[BUFF_SIZE];
int rc = -1;
struct nlmsghdr *nl_hdr;
struct cn_msg *cn_hdr;
enum proc_cn_mcast_op *mcop_msg;
size_t recv_len = 0;
FILE *f;
if (argc == 1)
strcpy(cpuctl_fs_path, "/dev/cpuctl");
else
strcpy(cpuctl_fs_path, argv[1]);
chdir(cpuctl_fs_path);
f = fopen("tasks", "r");
if (f == NULL) {
printf("Container not mounted at %s\n", cpuctl_fs_path);
return -1;
}
fclose(f);
f = fopen("notify_on_release", "r");
if (f == NULL) {
printf("Container not mounted at %s\n", cpuctl_fs_path);
return -1;
}
fclose(f);
if (getuid() != 0) {
printf("Only root can start/stop the fork connector\n");
return 0;
}
/*
* Create an endpoint for communication. Use the kernel user
* interface device (PF_NETLINK) which is a datagram oriented
* service (SOCK_DGRAM). The protocol used is the connector
* protocol (NETLINK_CONNECTOR)
*/
sk_nl = socket(PF_NETLINK, SOCK_DGRAM, NETLINK_CONNECTOR);
if (sk_nl == -1) {
printf("socket sk_nl error");
return rc;
}
my_nla.nl_family = AF_NETLINK;
my_nla.nl_groups = CN_IDX_PROC;
my_nla.nl_pid = getpid();
kern_nla.nl_family = AF_NETLINK;
kern_nla.nl_groups = CN_IDX_PROC;
kern_nla.nl_pid = 1;
err = bind(sk_nl, (struct sockaddr *)&my_nla, sizeof(my_nla));
if (err == -1) {
printf("binding sk_nl error");
goto close_and_exit;
}
nl_hdr = (struct nlmsghdr *)buff;
cn_hdr = (struct cn_msg *)NLMSG_DATA(nl_hdr);
mcop_msg = (enum proc_cn_mcast_op*)&cn_hdr->data[0];
printf("sending proc connector: PROC_CN_MCAST_LISTEN... ");
memset(buff, 0, sizeof(buff));
*mcop_msg = PROC_CN_MCAST_LISTEN;
signal(INTR_SIG, handle_intr);
/* fill the netlink header */
nl_hdr->nlmsg_len = SEND_MESSAGE_LEN;
nl_hdr->nlmsg_type = NLMSG_DONE;
nl_hdr->nlmsg_flags = 0;
nl_hdr->nlmsg_seq = 0;
nl_hdr->nlmsg_pid = getpid();
/* fill the connector header */
cn_hdr->id.idx = CN_IDX_PROC;
cn_hdr->id.val = CN_VAL_PROC;
cn_hdr->seq = 0;
cn_hdr->ack = 0;
cn_hdr->len = sizeof(enum proc_cn_mcast_op);
if (send(sk_nl, nl_hdr, nl_hdr->nlmsg_len, 0) != nl_hdr->nlmsg_len) {
printf("failed to send proc connector mcast ctl op!\n");
goto close_and_exit;
}
printf("sent\n");
for(memset(buff, 0, sizeof(buff)), from_nla_len = sizeof(from_nla);
; memset(buff, 0, sizeof(buff)), from_nla_len = sizeof(from_nla)) {
struct nlmsghdr *nlh = (struct nlmsghdr*)buff;
memcpy(&from_nla, &kern_nla, sizeof(from_nla));
recv_len = recvfrom(sk_nl, buff, BUFF_SIZE, 0,
(struct sockaddr*)&from_nla, &from_nla_len);
if (recv_len < 1)
continue;
while (NLMSG_OK(nlh, recv_len)) {
cn_hdr = NLMSG_DATA(nlh);
if (nlh->nlmsg_type == NLMSG_NOOP)
continue;
if ((nlh->nlmsg_type == NLMSG_ERROR) ||
(nlh->nlmsg_type == NLMSG_OVERRUN))
break;
if(handle_msg(cn_hdr)<0) {
goto close_and_exit;
}
if (nlh->nlmsg_type == NLMSG_DONE)
break;
nlh = NLMSG_NEXT(nlh, recv_len);
}
}
close_and_exit:
close(sk_nl);
exit(rc);
return 0;
}Re: containers (was Re: -mm merge plans for 2.6.23)
Quoted 2 lines · Srivatsa
The fact that we will have two interface for group scheduler in 2.6.24 is what worries me a bit (one user-id based and other container based).
Yeah.
One -could- take linear combinations, as Peter drew in his ascii art, but would one -want- to do that?
I imagine some future time, when users of this wonder why the API is more complicated than seems necessary, with two factors determining task-groups where one seems sufficient, and the answer is "the other factor, user-id's, is just there because we needed it as an interim mechanism, and then had to keep it, to preserve ongoing compatibility. That's not a very persuasive justification.
Signature · 3 lines
I won't rest till it's the best ...
Programmer, Linux Scalability
Paul Jackson <[email protected]> 1.925.600.0401Peter Zijlstra
maintainerRe: containers (was Re: -mm merge plans for 2.6.23)
Quoted 8 lines · Paul Jackson
Quoted 2 lines · Srivatsa
The fact that we will have two interface for group scheduler in 2.6.24 is what worries me a bit (one user-id based and other container based).
Yeah.
One -could- take linear combinations, as Peter drew in his ascii art, but would one -want- to do that?
I'd very much like to have it, but that is just me. We could take a weight of 0 to mean disabling of that grouping and default to that. That way it would not complicate regular behaviour.
It could be implemented with a simple hashing scheme where sched_group_hash(tsk) and sched_group_cmp(tsk, group->some_task) could be used to identify a schedule group.
pseudo code:
u64 sched_group_hash(struct task_struct *tsk)
{
u64 hash = 0;
if (tsk->pid->weight)
hash_add(&hash, tsk->pid);
if (tsk->pgrp->weight)
hash_add(&hash, tsk->pgrp);
if (tsk->uid->weight)
hash_add(&hash, tsk->uid);
if (tsk->container->weight)
hash_add(&hash, tsk->container);
...
return hash;
}s64 sched_group_cmp(struct task_struct *t1, struct task_struct *t2)
{
s64 cmp;
if (t1->pid->weight || t2->pid->weight) {
cmp = t1->pid->weight - t2->pid->weight;
if (cmp)
return cmp;
}
...
return 0;
}u64 sched_group_weight(struct task_struct *tsk)
{
u64 weight = 1024; /* 1 fixed point 10 bits */
if (tsk->pid->weight) {
weight *= tsk->pid->weight;
weight /= 1024;
}
....
return weight;
}Re: containers (was Re: -mm merge plans for 2.6.23)
Quoted 1 line · Peter
I'd very much like to have it, but that is just me.
Why? [linear combinations of uid, container, pid, pgrp weighting]
You provide some implementation details and complications, but no motivation that I noticed.
Well ... a little motivation ... "just me", which would go a long way of your first name was Linus. For the rest of us ... ;).
Signature · 3 lines
I won't rest till it's the best ...
Programmer, Linux Scalability
Paul Jackson <[email protected]> 1.925.600.0401Peter Zijlstra
maintainerRe: containers (was Re: -mm merge plans for 2.6.23)
Quoted 4 lines · Paul Jackson
Quoted 1 line · Peter
I'd very much like to have it, but that is just me.
Why? [linear combinations of uid, container, pid, pgrp weighting]
Good question, and I really have no other answer than that it seems usefull and not impossible (or even hard) to implement :-/
I'm not even that interested in using it, it just seems like a nice idea.
Re: containers (was Re: -mm merge plans for 2.6.23)
In reply to Srivatsa VaddagiriQuoted 4 lines · Srivatsa Vaddagiri
Quoted 1 line
(btw., if this goes into 2.6.23 then we cannot possibly turn it off in 2.6.24,
The fact that we will have two interface for group scheduler in 2.6.24 is what worries me a bit (one user-id based and other container based).
I know breaking user-interface is a bad thing across releases. But in this particular case, it's probably ok (since fair-group scheduling is a brand new feature in Linux)?
If we have that option of breaking API between 2.6.23 and 2.6.24 for fair-group scheduler, then we are in a much more flexible position.
For 2.6.23, I can send a user-id based interface for fair-group scheduler (with some /proc interface to tune group nice value).
For 2.6.24, this user-id interface will be removed and we will instead switch to container based interface. Fair-user scheduling will continue to work, its just that users will have to use a daemon (sources sent in previous mail) to enable it on top of container-based interface.
Hmm..?
Signature · 2 lines
Regards, vatsa
Re: containers (was Re: -mm merge plans for 2.6.23)
In reply to Srivatsa VaddagiriQuoted 2 lines · Srivatsa
So Ingo was proposing we use cpuset as that user interface to manage task-groups. This will be only for 2.6.23.
Good explanation - thanks.
In short, the proposal was to use the task partition defined by cpusets to define CFS task-groups, until the real process containers are available.
Or, I see in the next message, Ingo responding favorably to your alternative, using task uid's to partition the tasks into CFS task-groups.
Yeah, Ingo's preference for using uid's (or gid's ??) sounds right to me - a sustainable API.
Wouldn't want to be adding a cpuset API for a single 2.6.N release.
... gid's -- why not?
Signature · 3 lines
I won't rest till it's the best ...
Programmer, Linux Scalability
Paul Jackson <[email protected]> 1.925.600.0401Peter Zijlstra
maintainerRe: containers (was Re: -mm merge plans for 2.6.23)
Quoted 14 lines · Paul Jackson
Quoted 2 lines · Srivatsa
So Ingo was proposing we use cpuset as that user interface to manage task-groups. This will be only for 2.6.23.
Good explanation - thanks.
In short, the proposal was to use the task partition defined by cpusets to define CFS task-groups, until the real process containers are available.
Or, I see in the next message, Ingo responding favorably to your alternative, using task uid's to partition the tasks into CFS task-groups.
Quoted 6 lines
Yeah, Ingo's preference for using uid's (or gid's ??) sounds right to me - a sustainable API.
Wouldn't want to be adding a cpuset API for a single 2.6.N release.
.... gid's -- why not?
Or process or process groups, or all of the above :-)
One thing to think on though, we cannot have per process,uid,gid,pgrp scheduling for one release only. So we'd have to manage interaction with process containers. It might be that a simple weight multiplication scheme is good enough:
weight = uid_weight * pgrp_weight * container_weight
Of course, if we'd only have a single level group scheduler (as was proposed IIRC) it'd have to create intersection sets (as there might be non trivial overlaps) based on these various weights and schedule these resulting sets instead of the initial groupings.
Peter Zijlstra
maintainerRe: containers (was Re: -mm merge plans for 2.6.23)
Quoted 30 lines · Peter Zijlstra
Quoted 14 lines · Paul Jackson
Quoted 2 lines · Srivatsa
So Ingo was proposing we use cpuset as that user interface to manage task-groups. This will be only for 2.6.23.
Good explanation - thanks.
In short, the proposal was to use the task partition defined by cpusets to define CFS task-groups, until the real process containers are available.
Or, I see in the next message, Ingo responding favorably to your alternative, using task uid's to partition the tasks into CFS task-groups.
Quoted 6 lines
Yeah, Ingo's preference for using uid's (or gid's ??) sounds right to me - a sustainable API.
Wouldn't want to be adding a cpuset API for a single 2.6.N release.
.... gid's -- why not?
Or process or process groups, or all of the above :-)
One thing to think on though, we cannot have per process,uid,gid,pgrp scheduling for one release only. So we'd have to manage interaction with process containers. It might be that a simple weight multiplication scheme is good enough:
Quoted 6 lines
weight =
uid_weight*pgrp_weight*container_weightOf course, if we'd only have a single level group scheduler (as was proposed IIRC) it'd have to create intersection sets (as there might be non trivial overlaps) based on these various weights and schedule these resulting sets instead of the initial groupings.
Lets illustrate with some ASCII art:
so we have this dual level weight grouping (uid, container)
uid: a a a a a b b b b b c c c c c container: A A A A A A A B B B B B B B B
set: 1 1 1 1 1 2 2 3 3 3 4 4 4 4 4
resulting in schedule sets 1,2,3,4
so that (for instance) weight_2 = weight_b * weight_A
Re: containers (was Re: -mm merge plans for 2.6.23)
Quoted 6 lines · Peter Zijlstra
Quoted 6 lines
One thing to think on though, we cannot have per process,uid,gid,pgrp scheduling for one release only. So we'd have to manage interaction with process containers. It might be that a simple weight multiplication scheme is good enough:
weight =
uid_weight*pgrp_weight*container_weight
We would need something like this to flatten hierarchy, so that for example it is possible to do fair-container scheduling + fair-user/process scheduling inside a container using a hierarchy depth of just 1 (containers) that core scheduler understands. We discussed this a bit at
http://marc.info/?l=linux-kernel&m=118054481416140&w=2 and is very much on my todo list to experiment with.
Quoted 7 lines
Quoted 4 lines
Of course, if we'd only have a single level group scheduler (as was proposed IIRC) it'd have to create intersection sets (as there might be non trivial overlaps) based on these various weights and schedule these resulting sets instead of the initial groupings.
Lets illustrate with some ASCII art:
Quoted 8 lines
so we have this dual level weight grouping (uid, container)
uid: a a a a a b b b b b c c c c c container: A A A A A A A B B B B B B B Bset: 1 1 1 1 1 2 2 3 3 3 4 4 4 4 4
resulting in schedule sets 1,2,3,4
Wouldn't it be simpler if admin created these sets as containers directly? i.e:
uid: a a a a a b b b b b c c c c c container: 1 1 1 1 1 2 2 3 3 3 4 4 4 4 4
That way scheduler will not have to "guess" such intersecting schedulable sets/groups. It seems much simpler to me this way.
Surely there is some policy which is driving some tasks of userid 'b' to be in container A and some to be in B. It should be trivial enough to hook onto that policy making script and create separate containers like above.
Quoted 1 line
so that (for instance)
weight_2=weight_b*weight_A
Signature · 2 lines
Regards, vatsa
Re: containers (was Re: -mm merge plans for 2.6.23)
In reply to Andrew MortonQuoted 4 lines · Andrew Morton
I'm inclined to take the cautious route here - I don't think people will be dying for the CFS thingy (which I didn't even know about?) in .23, and it's rather a lot of infrastructure to add for a CPU scheduler configurator
Selecting the relevant patches to give enough of the container framework to support a CFS container subsystem (slightly tweaked/updated versions of the base patch, procfs interface patch and tasks file interface patch) is about 1600 lines in kernel/container.c and another 200 in kernel/container.h, which is about 99% of the non-documentation changes.
So not tiny, but it's not very intrusive on the rest of the kernel, and would avoid having to introduce a temporary API based on uids.
Paul
Re: containers (was Re: -mm merge plans for 2.6.23)
Quoted 11 lines · Paul Menage
Quoted 3 lines
I'm inclined to take the cautious route here - I don't think people will be dying for the CFS thingy (which I didn't even know about?) in .23, and it's rather a lot of infrastructure to add for a CPU scheduler configurator
Selecting the relevant patches to give enough of the container framework to support a CFS container subsystem (slightly tweaked/updated versions of the base patch, procfs interface patch and tasks file interface patch) is about 1600 lines in
kernel/container.cand another 200 inkernel/container.h, which is about 99% of the non-documentation changes.
Quoted 2 lines
So not tiny, but it's not very intrusive on the rest of the kernel, and would avoid having to introduce a temporary API based on uids.
Yes that would be good. As long as the user-land interface for process containers doesn't change (much?) between 2.6.23 and later releases this should be a good workaround for us.
Signature · 2 lines
Regards, vatsa
Theodore Tso
Appliedfallocate-implementation-on-i86-x86_64-and-powerpc.patch (was: re: -mm merge plans for 2.6.23)
In reply to Andrew MortonQuoted 3 lines · Andrew Morton
Merge
fallocate-implementation-on-i86-x86_64-and-powerpc.patch
Andrew,
Could you replace the comment/header section of fallocate-implementation-on-i86-x86_64-and-powerpc.patch with the following (attached below) ? This is from the ext4 patches, where Amit had cleaned up description, which will make for a cleaner and easier to understand submission into the git tree.
I've reviewed the other fallocate patches, noting the request to drop the s390 patches since Martin has said he will wire up it up after this hits mainline, and the only other change that I've found between what we have in the ext4 tree and -mm is that we have
fallocate-on-ia64.patch
and
fallocate-on-ia64-fix.patch
merged into a single patch. It probably would be better to merge them before sending it off to Linus, in the interests of cleanliness and making the tree more git-bisect friendly.
Regards,
- Ted
From: Amit Arora <[email protected]>
sys_fallocate() implementation on i386, x86_64 and powerpc
fallocate() is a new system call being proposed here which will allow applications to preallocate space to any file(s) in a file system. Each file system implementation that wants to use this feature will need to support an inode operation called ->fallocate(). Applications can use this feature to avoid fragmentation to certain level and thus get faster access speed. With preallocation, applications also get a guarantee of space for particular file(s) - even if later the the system becomes full.
Currently, glibc provides an interface called posix_fallocate() which can be used for similar cause. Though this has the advantage of working on all file systems, but it is quite slow (since it writes zeroes to each block that has to be preallocated). Without a doubt, file systems can do this more efficiently within the kernel, by implementing the proposed fallocate() system call. It is expected that posix_fallocate() will be modified to call this new system call first and incase the kernel/filesystem does not implement it, it should fall back to the current implementation of writing zeroes to the new blocks. ToDos:
1. Implementation on other architectures (other than i386, x86_64, ppc64 and s390(x)). David Chinner has already posted a patch for ia64.
2. A generic file system operation to handle fallocate (generic_fallocate), for filesystems that do _not_ have the fallocate inode operation implemented.
3. Changes to glibc,
a) to support fallocate() system call
b) to make posix_fallocate() and posix_fallocate64() call fallocate()
Andrew Morton
maintainerRe: fallocate-implementation-on-i86-x86_64-and-powerpc.patch (was: re: -mm merge plans for 2.6.23)
Quoted 5 lines · On Tue, 10 Jul 2007 07:52:51 -0400 Theodore Tso <[email protected]> wrote:
Quoted 3 lines · Andrew Morton
Merge
fallocate-implementation-on-i86-x86_64-and-powerpc.patch
Quoted 7 lines
Andrew,
Could you replace the comment/header section of fallocate-implementation-on-i86-x86_64-and-powerpc.patch with the following (attached below) ? This is from the ext4 patches, where Amit had cleaned up description, which will make for a cleaner and easier to understand submission into the git tree.
There were issues with the x86 patch, the s390 patch was wrong and Tony wants the the ia64 patch to use a different syscall number.
So I dropped everything. Let's start again from scratch. I'd suggest that for now we go with just an i386/x86_64 implementation, let the arch maintainers wire things up when that has settled down.
Re: fallocate-implementation-on-i86-x86_64-and-powerpc.patch
Quoted 3 lines · Andrew Morton
So I dropped everything. Let's start again from scratch. I'd suggest that for now we go with just an i386/x86_64 implementation, let the arch maintainers wire things up when that has settled down.
It's my observation that that plan usually works the best. Arch maintainers come along and wire up batches of syscalls when they have a chance to glance at the ABI, and catch up with x86[-64].
Jeff
Re: fallocate-implementation-on-i86-x86_64-and-powerpc.patch
Quoted 7 lines · Jeff Garzik
Quoted 3 lines · Andrew Morton
So I dropped everything. Let's start again from scratch. I'd suggest that for now we go with just an i386/x86_64 implementation, let the arch maintainers wire things up when that has settled down.
It's my observation that that plan usually works the best. Arch
... except when the initial implementer picks an argument order which doesn't work on some archs, as happened with sys_sync_file_range. That is also the case with fallocate IIRC.
We did come up with an order that worked for everybody, but that discussion seemed to get totally ignored by the ext4 developers.
Paul.
Andrew Morton
maintainerRe: fallocate-implementation-on-i86-x86_64-and-powerpc.patch
Quoted 2 lines · On Wed, 11 Jul 2007 09:27:40 +1000 Paul Mackerras <[email protected]> wrote:
We did come up with an order that worked for everybody, but that discussion seemed to get totally ignored by the ext4 developers.
It was a long discussion.
Can someone please remind us what the signature of the syscall (and the compat handler) should be?
Re: fallocate-implementation-on-i86-x86_64-and-powerpc.patch
Quoted 10 lines · Andrew Morton
Quoted 2 lines · On Wed, 11 Jul 2007 09:27:40 +1000 Paul Mackerras <[email protected]> wrote:
We did come up with an order that worked for everybody, but that discussion seemed to get totally ignored by the ext4 developers.
It was a long discussion.
Can someone please remind us what the signature of the syscall (and the compat handler) should be?
long sys_fallocate(loff_t offset, loff_t len, int fd, int mode)
should work for everybody. The compat handler would be
long compat_sys_fallocate(u32 offset_hi, u32 offset_lo, u32 len_hi, u32 len_lo,
int fd, int mode)
for big-endian, or swap hi/lo for little-endian. (Actually it would be good to have an arch-dependent "stitch two args together" macro and call them offset_0, offset_1 etc.)
Paul.
Re: fallocate-implementation-on-i86-x86_64-and-powerpc.patch
Quoted 5 lines · Paul Mackerras
Quoted 5 lines
Quoted 2 lines · On Wed, 11 Jul 2007 09:27:40 +1000 Paul Mackerras <[email protected]> wrote:
We did come up with an order that worked for everybody, but that discussion seemed to get totally ignored by the ext4 developers.
Well, in the end it was a toss-up between
asmlinkage long sys_fallocate(int fd, int mode, loff_t offset, loff_t len)
and
asmlinkage long sys_fallocate(loff_t offset, loff_t len, int fd, int mode)
There were a number of folks who preferred having int fd first, and I *thought* Amit had gotten agreement from either Martin or Heiko that it was ok to do this as an exception, even though it was extra work for that arch. But if not, we can try going back the second alternative, or even the 6 32-bits args (off_high, off_low, len_high, len_low) approach, but I think that drew even more fire.
Basically, no one approach made everyone happy, and at the end of the day sometimes you have to choose. I thought we had settled this in May with something that people could live with, but if we need to reopen the discussion, better now than later.....
- Ted
Re: fallocate-implementation-on-i86-x86_64-and-powerpc.patch
Quoted 13 lines · Theodore Tso
Quoted 5 lines · Paul Mackerras
Quoted 5 lines
Quoted 2 lines · On Wed, 11 Jul 2007 09:27:40 +1000 Paul Mackerras <[email protected]> wrote:
We did come up with an order that worked for everybody, but that discussion seemed to get totally ignored by the ext4 developers.
Well, in the end it was a toss-up between
asmlinkage long
sys_fallocate(int fd, int mode, loff_t offset, loff_t len)and
Quoted 8 lines
asmlinkage long
sys_fallocate(loff_t offset, loff_t len, int fd, int mode)There were a number of folks who preferred having int fd first, and I *thought* Amit had gotten agreement from either Martin or Heiko that it was ok to do this as an exception, even though it was extra work for that arch. But if not, we can try going back the second alternative, or even the 6 32-bits args (
off_high,off_low,len_high,len_low) approach, but I think that drew even more fire.
The second approach would work for all architectures.. but some people didn't like (no technical reason) not having fd as first argument.
Just go ahead with the current approach. s390 seems to be the only architecture which suffers from this and I wouldn't like to start this discussion again.
Re: fallocate-implementation-on-i86-x86_64-and-powerpc.patch
Quoted 9 lines · Heiko Carstens
Quoted 6 lines
There were a number of folks who preferred having int fd first, and I *thought* Amit had gotten agreement from either Martin or Heiko that it was ok to do this as an exception, even though it was extra work for that arch. But if not, we can try going back the second alternative, or even the 6 32-bits args (
off_high,off_low,len_high,len_low) approach, but I think that drew even more fire.The second approach would work for all architectures.. but some people didn't like (no technical reason) not having fd as first argument.
For s390 we would have liked the second approach with the two int's as last arguments since it would avoid the wrapper in the kernel. It does not avoid the wrapper in user space since the call uses 6 register on 31 bit. So the fallocate call need special treatement in glibc so I don't mind that it needs another wrapper in the kernel.
Quoted 3 lines
Just go ahead with the current approach. s390 seems to be the only architecture which suffers from this and I wouldn't like to start this discussion again.
Yes, don't worry about s390 for fallocate, the patch that had been in -mm only had an incorrect system call number. The wrapper is fine.
Signature · 4 lines
blue skies, Martin. "Reality continues to ruin my life." - Calvin.
Re: fallocate-implementation-on-i86-x86_64-and-powerpc.patch (was: re: -mm merge plans for 2.6.23)
In reply to Andrew MortonQuoted 3 lines · Andrew Morton
So I dropped everything. Let's start again from scratch. I'd suggest that for now we go with just an i386/x86_64 implementation, let the arch maintainers wire things up when that has settled down.
Ok, so no objections if we push the i386/x86_64 implementation (only), plus the ext4 support to Linus?
- Ted
Andrew Morton
maintainerRe: fallocate-implementation-on-i86-x86_64-and-powerpc.patch (was: re: -mm merge plans for 2.6.23)
Quoted 8 lines · On Tue, 10 Jul 2007 15:07:35 -0400 Theodore Tso <[email protected]> wrote:
Quoted 3 lines · Andrew Morton
So I dropped everything. Let's start again from scratch. I'd suggest that for now we go with just an i386/x86_64 implementation, let the arch maintainers wire things up when that has settled down.
Ok, so no objections if we push the i386/x86_64 implementation (only), plus the ext4 support to Linus?
Sounds like a plan.
I haven't seriously looked at ext4 code in many months. When I did I found the changes to be quite incomprehensible, very, very poorly commented and with quite a lot of odd-looking things about which I asked but got, iirc, no useful reply.
Hopefully it got better.
Which patches are you proposing merging into 2.6.23?
clam
In reply to Andrew MortonAndrew Morton wrote:
[...]
Quoted 6 lines
lumpy-reclaim-v4.patch have-kswapd-keep-a-minimum-order-free-other-than-order-0.patch only-check-absolute-watermarks-for-alloc_high-and-alloc_harder-allocations.patch
Lumpy reclaim. In a similar situation to Mel's patches. Stuck due to general lack or interest and effort.
The lumpy reclaim patches originally came out of work to support Mel's anti-fragmentation work. As such I think they have become somewhat attached to those patches. Whilst lumpy is most effective where placement controls are in place as offered by Mel's work, we see benefit from reduction in the "blunderbuss" effect when we reclaim at higher orders. While placement control is pretty much required for the very highest orders such as huge page size, lower order allocations are benefited in terms of lower collateral damage.
There are now a few areas other than huge page allocations which can benefit. Stacks are still order 1. Jumbo frames want higher order contiguous pages for there incoming hardware buffers. SLUB is showing performance benefits from moving to a higher allocation order. All of these should benefit from more aggressive targeted reclaim, indeed I have been surprised just how often my test workloads trigger lumpy at order 1 to get new stacks.
Truly representative work loads are hard to generate for some of these.
Though we have heard some encouraging noises from those who can
reproduce these problems.
[...]
-apw
Re: Re: -mm merge plans -- lumpy reclaim
[Seems a PEBKAC occured on the subject line, resending lest it become a victim of "oh thats spam".]
Quoted 34 lines · Andy Whitcroft
Andrew Morton wrote:
[...]
Quoted 6 lines
lumpy-reclaim-v4.patch have-kswapd-keep-a-minimum-order-free-other-than-order-0.patch only-check-absolute-watermarks-for-alloc_high-and-alloc_harder-allocations.patch
Lumpy reclaim. In a similar situation to Mel's patches. Stuck due to general lack or interest and effort.
The lumpy reclaim patches originally came out of work to support Mel's anti-fragmentation work. As such I think they have become somewhat attached to those patches. Whilst lumpy is most effective where placement controls are in place as offered by Mel's work, we see benefit from reduction in the "blunderbuss" effect when we reclaim at higher orders. While placement control is pretty much required for the very highest orders such as huge page size, lower order allocations are benefited in terms of lower collateral damage.
There are now a few areas other than huge page allocations which can benefit. Stacks are still order 1. Jumbo frames want higher order contiguous pages for there incoming hardware buffers. SLUB is showing performance benefits from moving to a higher allocation order. All of these should benefit from more aggressive targeted reclaim, indeed I have been surprised just how often my test workloads trigger lumpy at order 1 to get new stacks.
Truly representative work loads are hard to generate for some of these.
Though we have heard some encouraging noises from those who can
reproduce these problems.[...]
-apw
Andrew Morton
maintainerRe: -mm merge plans -- lumpy reclaim
Quoted 34 lines · On Wed, 11 Jul 2007 10:34:31 +0100 Andy Whitcroft <[email protected]> wrote:
[Seems a PEBKAC occured on the subject line, resending lest it become a victim of "oh thats spam".]
Quoted 30 lines · Andy Whitcroft
Andrew Morton wrote:
[...]
Quoted 6 lines
lumpy-reclaim-v4.patch have-kswapd-keep-a-minimum-order-free-other-than-order-0.patch only-check-absolute-watermarks-for-alloc_high-and-alloc_harder-allocations.patch
Lumpy reclaim. In a similar situation to Mel's patches. Stuck due to general lack or interest and effort.
The lumpy reclaim patches originally came out of work to support Mel's anti-fragmentation work. As such I think they have become somewhat attached to those patches. Whilst lumpy is most effective where placement controls are in place as offered by Mel's work, we see benefit from reduction in the "blunderbuss" effect when we reclaim at higher orders. While placement control is pretty much required for the very highest orders such as huge page size, lower order allocations are benefited in terms of lower collateral damage.
There are now a few areas other than huge page allocations which can benefit. Stacks are still order 1. Jumbo frames want higher order contiguous pages for there incoming hardware buffers. SLUB is showing performance benefits from moving to a higher allocation order. All of these should benefit from more aggressive targeted reclaim, indeed I have been surprised just how often my test workloads trigger lumpy at order 1 to get new stacks.
Truly representative work loads are hard to generate for some of these.
Though we have heard some encouraging noises from those who can
reproduce these problems.
I'd expect that the main application for lumpy-reclaim is in keeping a pool of order-2 (say) pages in reserve for GFP_ATOMIC allocators. ie: jumbo frames.
At present this relies upon the wakeup_kswapd(..., order) mechanism.
How effective is this at solving the jumbo frame problem?
(And do we still have a jumbo frame problem? Reports seems to have subsided)
Re: -mm merge plans -- lumpy reclaim
Quoted 27 lines · Andrew Morton
Quoted 23 lines
Quoted 23 lines
Quoted 6 lines
lumpy-reclaim-v4.patch have-kswapd-keep-a-minimum-order-free-other-than-order-0.patch only-check-absolute-watermarks-for-alloc_high-and-alloc_harder-allocations.patch
Lumpy reclaim. In a similar situation to Mel's patches. Stuck due to general lack or interest and effort.
The lumpy reclaim patches originally came out of work to support Mel's anti-fragmentation work. As such I think they have become somewhat attached to those patches. Whilst lumpy is most effective where placement controls are in place as offered by Mel's work, we see benefit from reduction in the "blunderbuss" effect when we reclaim at higher orders. While placement control is pretty much required for the very highest orders such as huge page size, lower order allocations are benefited in terms of lower collateral damage.
There are now a few areas other than huge page allocations which can benefit. Stacks are still order 1. Jumbo frames want higher order contiguous pages for there incoming hardware buffers. SLUB is showing performance benefits from moving to a higher allocation order. All of these should benefit from more aggressive targeted reclaim, indeed I have been surprised just how often my test workloads trigger lumpy at order 1 to get new stacks.
Quoted 3 lines
Quoted 3 lines
Truly representative work loads are hard to generate for some of these.
Though we have heard some encouraging noises from those who can
reproduce these problems.
Quoted 7 lines
I'd expect that the main application for lumpy-reclaim is in keeping a pool of order-2 (say) pages in reserve for
GFP_ATOMICallocators. ie: jumbo frames.At present this relies upon the
wakeup_kswapd(..., order)mechanism.How effective is this at solving the jumbo frame problem?
The tie in between allocator and kswapd is essentially unchanged, so if allocators are dropping below the watermarks at the specified order, reclaim will be triggered at that order. Reclaim continues until we return above the high watermarks, at the order at which we are reclaiming.
What lumpy brings is a greater targetting of effort to get the pages. kswapd now uses the desired allocator order when applying reclaim. This leads to pressure being applied to contigious areas at the required order, and so a higher chance of that order becoming available. Traditional reclaim could end up applying pressure to a number of pages, but not all pages in any area at the required order, leading to a very low chance of success. By targetting areas at the required order we significantly increase the chances of success for any given amount of reclaim. As we will reclaim until we have the desired number of free pages, we will have to reclaim less to achieve this compared to random reclaim.
This certainly is appealing intuitivly, and our testing at higher orders shows that the cost of each reclaimed page is lower and more importantly the time to reclaim each page is reduced. So for a 'continuing' consumer like an incoming packet stream, we should have to do much less work and thus disrupt the system as a whole much less to get its pages.
Where demand for atomic higher order pages is not heavy we would expect kswapd to maintain free levels pages more readily and so under higher demand. Though it should be stressed without placement control success rates drop off significantly at higher orders as the probabality of reclaim succeeding on all pages in the area tends to zero.
Quoted 1 line
(And do we still have a jumbo frame problem? Reports seems to have
subsided)
It is not in the least bit clear if the problem is resolved or if the reporters have simply gone quiet.
Overall the approach taken in lumpy reclaim seems to be a logical extension of the regular reclaim algorithm, leading to more efficient reclaim.
-apw
Re: -mm merge plans -- lumpy reclaim
In reply to Andrew MortonOn (11/07/07 09:46), Andrew Morton didst pronounce:
Quoted 41 lines · On Wed, 11 Jul 2007 10:34:31 +0100 Andy Whitcroft <[email protected]> wrote:
Quoted 35 lines
[Seems a PEBKAC occured on the subject line, resending lest it become a victim of "oh thats spam".]
Quoted 30 lines · Andy Whitcroft
Andrew Morton wrote:
[...]
Quoted 6 lines
lumpy-reclaim-v4.patch have-kswapd-keep-a-minimum-order-free-other-than-order-0.patch only-check-absolute-watermarks-for-alloc_high-and-alloc_harder-allocations.patch
Lumpy reclaim. In a similar situation to Mel's patches. Stuck due to general lack or interest and effort.
The lumpy reclaim patches originally came out of work to support Mel's anti-fragmentation work. As such I think they have become somewhat attached to those patches. Whilst lumpy is most effective where placement controls are in place as offered by Mel's work, we see benefit from reduction in the "blunderbuss" effect when we reclaim at higher orders. While placement control is pretty much required for the very highest orders such as huge page size, lower order allocations are benefited in terms of lower collateral damage.
There are now a few areas other than huge page allocations which can benefit. Stacks are still order 1. Jumbo frames want higher order contiguous pages for there incoming hardware buffers. SLUB is showing performance benefits from moving to a higher allocation order. All of these should benefit from more aggressive targeted reclaim, indeed I have been surprised just how often my test workloads trigger lumpy at order 1 to get new stacks.
Truly representative work loads are hard to generate for some of these.
Though we have heard some encouraging noises from those who can
reproduce these problems.I'd expect that the main application for lumpy-reclaim is in keeping a pool of order-2 (say) pages in reserve for
GFP_ATOMICallocators. ie: jumbo frames.
Quoted 5 lines
At present this relies upon the
wakeup_kswapd(..., order)mechanism.How effective is this at solving the jumbo frame problem?
(And do we still have a jumbo frame problem? Reports seems to have subsided)
The patches have an application with hugepage pool resizing.
When lumpy-reclaim is used used with ZONE_MOVABLE, the hugepages pool can be resized with greater reliability. Testing on a desktop machine with 2GB of RAM showed that growing the hugepage pool with ZONE_MOVABLE on it's own was very slow as the success rate was quite low. Without lumpy-reclaim, each attempt to grow the pool by 100 pages would yield 1 or 2 hugepages. With lumpy-reclaim, getting 40 to 70 hugepages on each attempt was typical.
Signature · 3 lines
Mel Gorman Part-time Phd Student Linux Technology Center University of Limerick IBM Dublin Software Lab
On Tuesday, 10 July 2007 10:31, Andrew Morton wrote:
[--snip--]
Quoted 4 lines
freezer-make-kernel-threads-nonfreezable-by-default.patch
Merge, subject to re-review.
Hmm, I'm not sure what that means. Am I supposed to do anything about it?
Greetings,
Rafael
Signature · 1 line
"Premature optimization is the root of all evil." - Donald Knuth
Quoting Andrew Morton ([email protected]):
...
Quoted 8 lines
implement-file-posix-capabilities.patch
implement-file-posix-capabilities-fix.patch
file-capabilities-introduce-cap_setfcap.patch
file-capabilities-get_file_caps-cleanups.patch
file-caps-update-selinux-xattr-hooks.patchfile-caps seems to be stuck. There has been some movement lately, might merge it subject to suiable acks from suitable parties.
Andrew Morgan has requested a series of changes. Since one of these would involve a change in the on-disk format of file capabilities, I guess these should (sigh) wait another cycle.
I will try to get that change out the door next, as soon as possible, so that hopefully there are no more definite blocking requests.
thanks,
-serge
Re: -mm merge plans for 2.6.23 (pcmcia)
In reply to Andrew MortonQuoted 3 lines · On Tue, 10 Jul 2007 01:31:52 -0700 Andrew Morton wrote:
When replying, please rewrite the subject suitably and try to Cc: the appropriate developer(s).
...
Quoted 4 lines
pcmcia-delete-obsolete-pcmcia_ioctl-feature.patch
use-menuconfig-objects-pcmcia.patchAm a bit stuck with the pcmcia patches. Dominik has disappeared.
The menuconfig patch looks fine.
I looked at the May-2007 discussion of ioctl removal. I don't see that much has changed since then, so it's either be brave/foolish/whatever and see what happens or just wait. I'll gladly send a patch to update the removal date in feature-removal-schedule.txt
---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
Andrew Morton
maintainerRe: -mm merge plans for 2.6.23 (pcmcia)
Quoted 6 lines · On Tue, 10 Jul 2007 09:29:58 -0700 Randy Dunlap <[email protected]> wrote:
Quoted 3 lines · On Tue, 10 Jul 2007 01:31:52 -0700 Andrew Morton wrote:
When replying, please rewrite the subject suitably and try to Cc: the appropriate developer(s).
Quoted 8 lines
...
Quoted 4 lines
pcmcia-delete-obsolete-pcmcia_ioctl-feature.patch
use-menuconfig-objects-pcmcia.patchAm a bit stuck with the pcmcia patches. Dominik has disappeared.
The menuconfig patch looks fine.
Yeah, I'll merge that.
Quoted 5 lines
I looked at the May-2007 discussion of ioctl removal. I don't see that much has changed since then, so it's either be brave/foolish/whatever and see what happens or just wait. I'll gladly send a patch to update the removal date in feature-removal-schedule.txt
I have a note here that the ioctl-removal patch needs Dominik consideration. I see no rush on it so I'll just sit on it.
Re: -mm merge plans for 2.6.23 - ioat/dma engine
In reply to Andrew MortonQuoted 6 lines · Andrew Morton
git-ioat-vs-git-md-accel.patch
ioat-warning-fix.patch
fix-i-oat-for-kexec.patchI don't seem to be able to get rid of these. Chris Leech appears to have vanished.
Chris is a moving target. Thankfully we have Shannon Nelson taking over Chris' duties. Shannon, can you take a look at these and see what needs to happen to it ? Most likely these just need to be pushed to the right person.
Cheers,
Auke
PS: I think we should add an I/OAT / DMA engine section in the MAINTAINERS...
RE: -mm merge plans for 2.6.23 - ioat/dma engine
Quoted 6 lines · Auke
Quoted 5 lines · Andrew Morton
git-ioat-vs-git-md-accel.patch
ioat-warning-fix.patch
fix-i-oat-for-kexec.patchI don't seem to be able to get rid of these. Chris Leech
Quoted 8 lines
appears to have
Quoted 1 line
vanished.
Chris is a moving target. Thankfully we have Shannon Nelson taking over Chris'
duties. Shannon, can you take a look at these and see what needs to happen to it
? Most likely these just need to be pushed to the right person.
Auke: Thanks for the introduction :-).
Andrew: All three of these patches are reasonable and can be pushed on up. You can add my sign-off to all three:
Quoted 9 lines
Cheers,
Auke
PS: I think we should add an I/OAT / DMA engine section in the
MAINTAINERS...
I'll be posting a MAINTAINERS patch Real Soon Now with my name on IOAT/DMA.
sln
======================================================================
Mr. Shannon Nelson LAN Access Division, Intel Corp.
[email protected] I don't speak for Intel
(503) 712-7659 Parents can't afford to be squeamish.
Andrew Morton
maintainerRe: -mm merge plans for 2.6.23 - ioat/dma engine
Quoted 10 lines · Shannon
Quoted 9 lines · Auke
Quoted 5 lines · Andrew Morton
git-ioat-vs-git-md-accel.patch
ioat-warning-fix.patch
fix-i-oat-for-kexec.patchI don't seem to be able to get rid of these. Chris Leech
appears to have
Quoted 1 line
vanished.
Quoted 7 lines
Quoted 5 lines
Chris is a moving target. Thankfully we have Shannon Nelson taking over Chris'
duties. Shannon, can you take a look at these and see what needs to happen to it
? Most likely these just need to be pushed to the right person.Auke: Thanks for the introduction :-).
Hi, Shannon.
Quoted 3 lines
Andrew: All three of these patches are reasonable and can be pushed on up. You can add my sign-off to all three:
Signed-off-by Shannon Nelson <[email protected]>
OK, the way it works is that I send these patches at the git tree maintainer, then the git tree maintainer merges them (this step is unreliable) and then when I repull that git tree maintainer's tree I see that they got merged so I drop them from -mm. The git tree maintainer decides when to send them to Linus.
I am presently pulling git://lost.foo-projects.org/~cleech/linux-2.6#master
into -mm.
Will you be taking over the IOAT git tree? If so, please send me a suitable git URL when it's ready.
The above tree has several changes in it from January (see ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.22-rc6/2.6.22-rc6-mm1/broken-out/git-ioat.patch).
Please take a look at those, work out what we should do with it all.
RE: -mm merge plans for 2.6.23 - ioat/dma engine
Andrew Morton [mailto:[email protected]]
Quoted 7 lines
I am presently pulling
git://lost.foo-projects.org/~cleech/linux-2.6#master
into -mm.Will you be taking over the IOAT git tree? If so, please send me a suitable git URL when it's ready.
I'll be getting there Real Soon Now. The transition seems to be a little rocky at the moment...
Quoted 4 lines
The above tree has several changes in it from January (see ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2
.6.22-rc6/2.6.22-rc6-mm1/broken-out/git-ioat.patch). Please take a look at those, work out what we should do with it all.
Will do. Thanks for your patience.
sln
======================================================================
Mr. Shannon Nelson LAN Access Division, Intel Corp.
[email protected] I don't speak for Intel
(503) 712-7659 Parents can't afford to be squeamish.
ata and netdev (was Re: -mm merge plans for 2.6.23)
In reply to Andrew Morton(just to provide my indicator of status)
Quoted 1 line · Andrew Morton
libata-config_pm=n-compile-fix.patch
that's for a branch that you don't get via libata-dev#ALL, #mv-ahci-pata.
Quoted 1 line
pata_acpi-restore-driver.patch
see Alan's comments. I've been ignoring pata_acpi for a while, because IMO it always needed work.
Quoted 1 line
libata-core-convert-to-use-cancel_rearming_delayed_work.patch
will merge
Quoted 1 line
libata-implement-ata_wait_after_reset.patch
I'm pretty much this is obsolete. Tejun?
Quoted 1 line
sata_promise-sata-hotplug-support.patch
will merge
Quoted 1 line
libata-add-irq_flags-to-struct-pata_platform_info-fix.patch
are other pata_platform people happy with this? I don't know embedded well enough to know if adding this struct member will break things.
Quoted 2 lines
ata-add-the-sw-ncq-support-to-sata_nv-for-mcp51-mcp55-mcp61.patch sata_nv-allow-changing-queue-depth.patch
should be combined, really. will merge eventually. basic concept OK, but need to review in depth.
Quoted 3 lines
pata_hpt3x3-major-reworking-and-testing.patch iomap-sort-out-the-broken-address-reporting-caused-by-the-iomap-layer.patch ata-use-iomap_name.patch
generally OK
Quoted 8 lines
libata-check-for-an-support.patch
scsi-expose-an-to-user-space.patch
libata-expose-an-to-user-space.patch
scsi-save-disk-in-scsi_device.patch
libata-send-event-when-an-received.patchAm sitting on these due to confusion regarding the status of the ata-ahci patches.
I will apply what I can, but it seems there are lifetime problems
Quoted 6 lines
ata-ahci-alpm-store-interrupt-value.patch ata-ahci-alpm-expose-power-management-policy-option-to-users.patch ata-ahci-alpm-enable-link-power-management-for-ata-drivers.patch ata-ahci-alpm-enable-aggressive-link-power-management-for-ahci-controllers.patch
These appear to need some work.
seemed mostly OK to me. what comments did I miss?
Quoted 1 line
libata-add-human-readable-error-value-decoding.patch
still pondering; in my mbox queue
Quoted 3 lines
libata-fix-hopefully-all-the-remaining-problems-with.patch testing-patch-for-ali-pata-fixes-hopefully-for-the-problems-with-atapi-dma.patch pata_ali-more-work.patch
No idea. I would poke Alan. Probably drop.
Quoted 4 lines
8139too-force-media-setting-fix.patch blackfin-on-chip-ethernet-mac-controller-driver.patch atari_pamsnetc-old-declaration-ritchie-style-fix.patch sundance-phy-address-form-0-only-for-device-id-0x0200.patch
Needs a bug fix, so that the newly modified loop doesn't scan the final phy id, then loop back around to scan the first again.
Quoted 5 lines
3x59x-fix-pci-resource-management.patch update-smc91x-driver-with-arm-versatile-board-info.patch drivers-net-ns83820c-add-paramter-to-disable-auto.patch
netdev patches which are stuck in limbo land.
? I don't think I've seen these.
Quoted 1 line
bonding-bond_mainc-make-2-functions-static.patch
FWIW bonding stuff should go to me, since it lives mostly in drivers/net
Quoted 1 line
x86-initial-fixmap-support.patch
Andi material?
Quoted 5 lines
mm-revert-kernel_ds-buffered-write-optimisation.patch revert-81b0c8713385ce1b1b9058e916edcf9561ad76d6.patch revert-6527c2bdf1f833cc18e8f42bd97973d583e4aa83.patch mm-clean-up-buffered-write-code.patch mm-debug-write-deadlocks.patch
Quoted 8 lines
mm-trim-more-holes.patch mm-buffered-write-cleanup.patch mm-write-iovec-cleanup.patch mm-fix-pagecache-write-deadlocks.patch mm-buffered-write-iterator.patch fs-fix-data-loss-on-error.patch mm-restore-kernel_ds-optimisations.patch
pagefault-in-write deadlock fixes. Will hold for 2.6.24.
Any of the above worth 2.6.23? Just wondering if they were useful cleanups / minor fixes prior to new aops patches?
Quoted 1 line
more-scheduled-oss-driver-removal.patch
ACK
Quoted 6 lines
oss-trident-massive-whitespace-removal.patch oss-trident-fix-locking-around-write_voice_regs.patch oss-trident-replace-deprecated-pci_find_device-with-pci_get_device.patch remove-options-depending-on-oss_obsolete.patch
Merge
what about just removing the OSS drivers in question? :)
Quoted 11 lines
intel-iommu-dmar-detection-and-parsing-logic.patch intel-iommu-pci-generic-helper-function.patch intel-iommu-clflush_cache_range-now-takes-size-param.patch intel-iommu-iova-allocation-and-management-routines.patch intel-iommu-intel-iommu-driver.patch intel-iommu-avoid-memory-allocation-failures-in-dma-map-api-calls.patch intel-iommu-intel-iommu-cmdline-option-forcedac.patch intel-iommu-dmar-fault-handling-support.patch intel-iommu-iommu-gfx-workaround.patch intel-iommu-iommu-floppy-workaround.patch
Quoted 2 lines
Don't know. I don't think there were any great objections, but I don't think much benefit has been demonstrated?
Just the general march of progress on new hardware :)
I would like to see this support merged in /some/ form. We've been telling Intel for years they were sillyheads for not bothering with an IOMMU. Now that they have, we should give them a cookie and support good technology.
Jeff
Andrew Morton
maintainerRe: ata and netdev (was Re: -mm merge plans for 2.6.23)
Quoted 2 lines · On Tue, 10 Jul 2007 13:42:16 -0400 Jeff Garzik <[email protected]> wrote:
(just to provide my indicator of status)
Thanks.
Quoted 4 lines
Quoted 1 line
libata-add-irq_flags-to-struct-pata_platform_info-fix.patch
are other
pata_platformpeople happy with this? I don't know embedded well enough to know if adding this struct member will break things.
This is just a silly remove-unneeded-cast-of-void* cleanup. I wrote this as a fixup against libata-add-irq_flags-to-struct-pata_platform_info.patch with the intention of folding it into that base patch, but you went and merged the submitter's original patch so this trivial fixup got stranded in -mm. Feel free to give it the piss-off-too-trivial treatment.
Quoted 8 lines
Quoted 6 lines
ata-ahci-alpm-store-interrupt-value.patch ata-ahci-alpm-expose-power-management-policy-option-to-users.patch ata-ahci-alpm-enable-link-power-management-for-ata-drivers.patch ata-ahci-alpm-enable-aggressive-link-power-management-for-ahci-controllers.patch
These appear to need some work.
seemed mostly OK to me. what comments did I miss?
Oh, I thought these were the patches which affected scsi and which James had issues with. I guess I got confused.
Quoted 11 lines
Quoted 2 lines
libata-add-human-readable-error-value-decoding.patch
still pondering; in my mbox queue
Quoted 3 lines
libata-fix-hopefully-all-the-remaining-problems-with.patch testing-patch-for-ali-pata-fixes-hopefully-for-the-problems-with-atapi-dma.patch pata_ali-more-work.patch
No idea. I would poke Alan. Probably drop.
Alan: poke.
Quoted 10 lines
Quoted 5 lines
8139too-force-media-setting-fix.patch blackfin-on-chip-ethernet-mac-controller-driver.patch atari_pamsnetc-old-declaration-ritchie-style-fix.patch sundance-phy-address-form-0-only-for-device-id-0x0200.patch
Needs a bug fix, so that the newly modified loop doesn't scan the final phy id, then loop back around to scan the first again.
Quoted 8 lines
Quoted 5 lines
3x59x-fix-pci-resource-management.patch update-smc91x-driver-with-arm-versatile-board-info.patch drivers-net-ns83820c-add-paramter-to-disable-auto.patch
netdev patches which are stuck in limbo land.
? I don't think I've seen these.
3x59x-fix-pci-resource-management.patch: you wrote it ;) I have a comment here:
- I don't remember the story with cardbus either. Presumably once upon a time the cardbus layer was claiming IO regions on behalf of cardbus devices (?)
Need to think about that.
update-smc91x-driver-with-arm-versatile-board-info.patch:
See comment from rmk in changelog:
ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.22-rc6/2.6.22-rc6-mm1/broken-out/update-smc91x-driver-with-arm-versatile-board-info.patch
Deepak, can we move this along a bit please?
drivers-net-ns83820c-add-paramter-to-disable-auto.patch:
See comments in changelog: ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.22-rc6/2.6.22-rc6-mm1/broken-out/drivers-net-ns83820c-add-paramter-to-disable-auto.patch
Dan, Ben: is there any prospect of progress here?
Quoted 5 lines
Quoted 2 lines
bonding-bond_mainc-make-2-functions-static.patch
FWIW bonding stuff should go to me, since it lives mostly in
drivers/net
Ah, noted.
Quoted 4 lines
Quoted 1 line
x86-initial-fixmap-support.patch
Andi material?
Spose so. But it's buried in the middle of a series of four patches.
Quoted 15 lines
Quoted 14 lines
mm-revert-kernel_ds-buffered-write-optimisation.patch revert-81b0c8713385ce1b1b9058e916edcf9561ad76d6.patch revert-6527c2bdf1f833cc18e8f42bd97973d583e4aa83.patch mm-clean-up-buffered-write-code.patch mm-debug-write-deadlocks.patch mm-trim-more-holes.patch mm-buffered-write-cleanup.patch mm-write-iovec-cleanup.patch mm-fix-pagecache-write-deadlocks.patch mm-buffered-write-iterator.patch fs-fix-data-loss-on-error.patch mm-restore-kernel_ds-optimisations.patch
pagefault-in-write deadlock fixes. Will hold for 2.6.24.
Quoted 3 lines
Any of the above worth 2.6.23? Just wondering if they were useful cleanups / minor fixes prior to new aops patches?
The first few patches will a) fix up our writev performance regression and
b) reintroduce the writev() deadlock which the writev()-regresion-adding patch fixed.
So it's all a bit ugly.
Quoted 10 lines
Quoted 7 lines
oss-trident-massive-whitespace-removal.patch oss-trident-fix-locking-around-write_voice_regs.patch oss-trident-replace-deprecated-pci_find_device-with-pci_get_device.patch remove-options-depending-on-oss_obsolete.patch
Merge
what about just removing the OSS drivers in question? :)
Hey, I only work here.
Quoted 15 lines
Quoted 12 lines
intel-iommu-dmar-detection-and-parsing-logic.patch intel-iommu-pci-generic-helper-function.patch intel-iommu-clflush_cache_range-now-takes-size-param.patch intel-iommu-iova-allocation-and-management-routines.patch intel-iommu-intel-iommu-driver.patch intel-iommu-avoid-memory-allocation-failures-in-dma-map-api-calls.patch intel-iommu-intel-iommu-cmdline-option-forcedac.patch intel-iommu-dmar-fault-handling-support.patch intel-iommu-iommu-gfx-workaround.patch intel-iommu-iommu-floppy-workaround.patch
Quoted 2 lines
Don't know. I don't think there were any great objections, but I don't think much benefit has been demonstrated?
Quoted 6 lines
Just the general march of progress on new hardware :)
I would like to see this support merged in /some/ form. We've been telling Intel for years they were sillyheads for not bothering with an IOMMU. Now that they have, we should give them a cookie and support good technology.
OK, thanks.
Re: ata and netdev (was Re: -mm merge plans for 2.6.23)
Quoted 11 lines · Andrew Morton
Quoted 8 lines
Quoted 6 lines
ata-ahci-alpm-store-interrupt-value.patch ata-ahci-alpm-expose-power-management-policy-option-to-users.patch ata-ahci-alpm-enable-link-power-management-for-ata-drivers.patch ata-ahci-alpm-enable-aggressive-link-power-management-for-ahci-controllers.patch
These appear to need some work.
seemed mostly OK to me. what comments did I miss?
Oh, I thought these were the patches which affected scsi and which James had issues with. I guess I got confused.
Well ... my concern was really how to make them more generic ... ahci isn't the only controller that can do phy power management, and it also seemed to me that the most generic entity for power management was the transport rather than the SCSI mid-layer, but that debate is still ongoing.
James
Re: ata and netdev (was Re: -mm merge plans for 2.6.23)
In reply to Andrew MortonQuoted 8 lines · Andrew Morton
Quoted 1 line · On Tue, 10 Jul 2007 13:42:16 -0400 Jeff Garzik <[email protected]> wrote:
(just to provide my indicator of status)
Thanks.
Quoted 1 line
Quoted 1 line
libata-add-irq_flags-to-struct-pata_platform_info-fix.patch
Quoted 8 lines
Quoted 1 line
are other
pata_platformpeople happy with this? I don't know embedded well enough to know if adding this struct member will break things.This is just a silly remove-unneeded-cast-of-void* cleanup. I wrote this as a fixup against libata-add-irq_flags-to-struct-pata_platform_info.patch with the intention of folding it into that base patch, but you went and merged the submitter's original patch so this trivial fixup got stranded in -mm. Feel free to give it the piss-off-too-trivial treatment.
I'm sorry, I didn't look closely enough. I was referring to the add-irq-flags patch itself, not your small fix.
Quoted 10 lines
Quoted 7 lines
Quoted 6 lines
ata-ahci-alpm-store-interrupt-value.patch ata-ahci-alpm-expose-power-management-policy-option-to-users.patch ata-ahci-alpm-enable-link-power-management-for-ata-drivers.patch ata-ahci-alpm-enable-aggressive-link-power-management-for-ahci-controllers.patch
These appear to need some work.
seemed mostly OK to me. what comments did I miss?
Oh, I thought these were the patches which affected scsi and which James had issues with. I guess I got confused.
hrm. ISTR James wanted some cleanups, Kristen did some cleanups, then looking at the cleanups decided they were needed / appropriate at this time.
Anyway, these are in my mbox queue and the libata portions (of which the code is the majority) seem OK. Need to give them a final review.
Jeff
Re: ata and netdev (was Re: -mm merge plans for 2.6.23)
In reply to Andrew MortonHello.
Quoted 1 line · Andrew Morton
3x59x-fix-pci-resource-management.patch: you wrote it ;) I have a comment
No, I did, almost a year ago already. :-)
Quoted 5 lines
here:
- I don't remember the story with cardbus either. Presumably once upon a time the cardbus layer was claiming IO regions on behalf of cardbus devices (?)
IIRC, that's your own comment.
Quoted 1 line
Need to think about that.
WBR, Sergei
Andrew Morton
maintainerRe: ata and netdev (was Re: -mm merge plans for 2.6.23)
Quoted 7 lines · On Wed, 11 Jul 2007 00:31:23 +0400 Sergei Shtylyov <[email protected]>…
Hello.
Quoted 1 line · Andrew Morton
3x59x-fix-pci-resource-management.patch: you wrote it ;) I have a comment
No, I did, almost a year ago already. :-)
I thought that was odd. I fixed the attribution.
Quoted 7 lines
Quoted 5 lines
here:
- I don't remember the story with cardbus either. Presumably once upon a time the cardbus layer was claiming IO regions on behalf of cardbus devices (?)
IIRC, that's your own comment.
yup, that's what "I have a comment" meant ;)
The comment seems rather bogus actually. Let's just merge it.
Re: ata and netdev (was Re: -mm merge plans for 2.6.23)
In reply to Andrew MortonQuoted 5 lines · Andrew Morton
drivers-net-ns83820c-add-paramter-to-disable-auto.patch:
See comments in changelog: ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.22-rc6/2.6.22-rc6-mm1/broken-out/drivers-net-ns83820c-add-paramter-to-disable-auto.patch
Dan, Ben: is there any prospect of progress here?
Mmm.. Ben had 2 comments last year:
In regards to the ethtool stuff i coded:
Quoted 1 line
This part is good, although doing something for copper cards needs doing,
I know very little about hardware and only own the fiber version of this card. Even if i tried to make code for the copper version, it would probably blow it up the phy and set the switches on fire ;).
And in regards to the '"disable_autoneg" module argument':
Quoted 1 line
This is the part I disagree with. Are you sure it isn't a bug in the link autonegotiation state machine for fibre cards? It should be defaulting to 1Gbit/full duplex if no autonegotiation is happening, and if it isn't then that should be fixed instead of papering over things with a config option.
This is pretty much Russian to me. I wouldnt know where to find the "link-autonegotiation-state-machine-for-fibre-cards" or know what to do with it anyway :).
The "disable_autoneg" is a convenient feature (for me and the other guy who made the same patch last year) and i consider it a harmless feature in every way. It is simply an 'if'-statement, that skips the "start autoneg" function upon load.
We can simply remove the feature entirely if it is deemed undesirable.
So in conclusion:
- I vote "use the patch as-is", but im fine with it being changed. - If it needs support for copper, someone else has to code it.
Regards
- Dan
Re: ata and netdev (was Re: -mm merge plans for 2.6.23)
In reply to Jeff GarzikHello.
Quoted 1 line · Jeff Garzik
Quoted 1 line
3x59x-fix-pci-resource-management.patch
Now that the fix for CONFIG_PCI=n has been merged, what's left is to test
this on EISA (at least Andrew wanted it :-).
Quoted 3 lines
Quoted 1 line
netdev patches which are stuck in limbo land.
? I don't think I've seen these.
You should have, I was sending it to you.
WBR, Sergei
ext2 reservations (Re: -mm merge plans for 2.6.23)
In reply to Andrew MortonQuoted 3 lines
ext2-reservations.patch
Still needs decent testing.
Was this oops silently fixed?
http://lkml.org/lkml/2007/3/2/138
2.6.21-rc2-mm1: EIP is at ext2_discard_reservation+0x1c/0x52
I still have that ext2 partition backed up.
Re: PCI probing changes
In reply to Andrew MortonQuoted 1 line · On Tuesday, July 10, 2007 1:31:52 Andrew Morton wrote:
pci-disable-decode-of-io-memory-during-bar-sizing.patch
This is a core PCI change, should probably go through Greg and/or linux-pci instead? Or just send it to Linus directly, iirc everyone was ok with the change for 2.6.23.
Also, you can add a
to it.
Thanks,
Jesse
Andrew Morton
maintainerRe: PCI probing changes
Quoted 6 lines · On Tue, 10 Jul 2007 11:34:03 -0700 Jesse Barnes <[email protected]> wrote:
Quoted 1 line · On Tuesday, July 10, 2007 1:31:52 Andrew Morton wrote:
pci-disable-decode-of-io-memory-during-bar-sizing.patch
This is a core PCI change, should probably go through Greg and/or linux-pci instead? Or just send it to Linus directly, iirc everyone was ok with the change for 2.6.23.
Ah, thanks. I moved it to the gregkh-pci queue.
Quoted 3 lines
Also, you can add a
Signed-off-by Jesse Barnes <[email protected]>to it.
Updated, thanks.
agp / cpufreq.
In reply to Andrew MortonQuoted 3 lines · Andrew Morton
working-3d-dri-intel-agpko-resume-for-i815-chip.patch
Sent to davej
You managed to sneak this to me just hours before I handed AGP maintainership to Dave Airlie. FWIW, I think this needs to redone in a much more generic manner before it goes mainline.
Quoted 4 lines
bugfix-cpufreq-in-combination-with-performance-governor.patch restore-previously-used-governor-on-a-hot-replugged-cpu.patch
Sent to davej
Will start merging the backlog once someone (ahem) pulls the last lot of stuff.
Dave
Signature · 1 line
http://www.codemonkey.org.uk
Quoted 6 lines · Andrew Morton
slub-exploit-page-mobility-to-increase-allocation-order.patch slub-reduce-antifrag-max-order.patch
These are slub changes which are dependent on Mel's stuff, and I have a note here that there were reports of page allocation failures with these. What's up with that?
Those were fixed and all has been well since as far as I know.
Quoted 3 lines
Maybe I should just drop the 100-odd marginal-looking MM patches? We're simply not showing compelling reasons for merging them and quite a lot of them are stuck in a 90% complete state.
As far as I can tell the antifrag patches are stable and are significantly enhancing various aspects of the VM and also make it more reliable. SLUB can use it to increase scalability. MM has been using order 3 allocs via SLUB for months now without a problem. Without the antifrag patches order 1 allocs could cause OOMs.
It opens the door for functionality that we wanted for a long time such a memory unplug etc.
On (10/07/07 13:09), Christoph Lameter didst pronounce:
Quoted 11 lines · Andrew Morton
Quoted 7 lines
slub-exploit-page-mobility-to-increase-allocation-order.patch slub-reduce-antifrag-max-order.patch
These are slub changes which are dependent on Mel's stuff, and I have a note here that there were reports of page allocation failures with these. What's up with that?
Those were fixed and all has been well since as far as I know.
SLUB using high orders without page allocation failures do depend on two very questionable patches that I brought to attention in my inital merge mail. If grouping pages by mobility goes through, I'll be revisiting that properly to make sure it can work without deadlocking ever under any circumstances. Right now, it theoritically could livelock although I've never been able to reproduce it.
The patches as they are will work for high-order allocations if you are willing to wait and reclaim memory. The more stressful users need more effort but it's already been shown that it can be made work with one approach as the last few months in -mm have shown.
Quoted 4 lines
Quoted 3 lines
Maybe I should just drop the 100-odd marginal-looking MM patches? We're simply not showing compelling reasons for merging them and quite a lot of them are stuck in a 90% complete state.
Quoted 8 lines
As far as I can tell the antifrag patches are stable and are significantly enhancing various aspects of the VM and also make it more reliable. SLUB can use it to increase scalability. MM has been using order 3 allocs via SLUB for months now without a problem. Without the antifrag patches order 1 allocs could cause OOMs.
It opens the door for functionality that we wanted for a long time such a memory unplug etc.
And I want to avoid a catch-22 here where the features that depend on grouping pages by mobility have to exist before grouping pages by mobility is pushed through.
I would like the patches to go through on the grounds that higher order allocations can succeed. However, I am also happy to say that order-0 pages should be used as much as possible, that case should always be made as fast as possible and the world must not end if a high-order allocation fails.
Signature · 4 lines
-- Mel Gorman Part-time Phd Student Linux Technology Center University of Limerick IBM Dublin Software Lab
Quoted 5 lines · Mel Gorman
I would like the patches to go through on the grounds that higher order allocations can succeed. However, I am also happy to say that order-0 pages should be used as much as possible, that case should always be made as fast as possible and the world must not end if a high-order allocation fails.
SLUB can easily be made to not use higher order pages.
If the SLUB mobility patches are not merged then higher order page use can be explicitly enabled via passing the following to the kernel on boot
slub_max_order=<desired max order>
If they are merged then the higher order page use can be disabled in case of trouble via
slub_max_order=0
Quoted 1 line · Andrew Morton
romfs-printk-format-warnings.patch
NACK on this one. This bloats romfs by almost half of it's previous size to add mtd support to it. Given that romfs is a compltely trivial filesystem it's much better to have a separate filesystem driver handling the format on mtd instead of adding all these indirections. In addition to that argument the switch on the underlying subsystem is done horrible. There's lots of ifdefs instead of proper functions pointers, there's one file containing both block and mtd code instead of seaparate files, etc.
And the get_unmapped_area method in a bare filesystem needs a _lot_ of explanation.
Quoted 4 lines · Christoph Hellwig
Quoted 1 line · Andrew Morton
romfs-printk-format-warnings.patch
NACK on this one.
The rest of it is nacked anyway, until we unify the point and get_unmapped_area methods of the MTD API.
Signature · 1 line
dwmw2
Andrew Morton
maintainerQuoted 9 lines · On Wed, 11 Jul 2007 12:39:42 +0100 David Woodhouse <[email protected]> wrote:
Quoted 4 lines · Christoph Hellwig
Quoted 1 line · Andrew Morton
romfs-printk-format-warnings.patch
NACK on this one.
The rest of it is nacked anyway, until we unify the point and
get_unmapped_areamethods of the MTD API.
Methinks you meant nommu-make-it-possible-for-romfs-to-use-mtd-devices.patch, not romfs-printk-format-warnings.patch.
I'll drop nommu-make-it-possible-for-romfs-to-use-mtd-devices.patch, thamks.
Quoted 12 lines · On Wed, 11 Jul 2007 10:21:03 -0700 Andrew Morton wrote:
Quoted 9 lines · On Wed, 11 Jul 2007 12:39:42 +0100 David Woodhouse <[email protected]> wrote:
Quoted 4 lines · Christoph Hellwig
Quoted 1 line · Andrew Morton
romfs-printk-format-warnings.patch
NACK on this one.
The rest of it is nacked anyway, until we unify the point and
get_unmapped_areamethods of the MTD API.
Quoted 5 lines
Methinks you meant nommu-make-it-possible-for-romfs-to-use-mtd-devices.patch, not romfs-printk-format-warnings.patch.
I'll drop nommu-make-it-possible-for-romfs-to-use-mtd-devices.patch, thamks.
Thanks. I was certainly getting confused.
---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
scsi, was Re: -mm merge plans for 2.6.23
In reply to Andrew MortonQuoted 20 lines
restore-acpi-change-for-scsi.patch git-scsi-misc-vs-greg-sysfs-stuff.patch aacraid-rename-check_reset.patch scsi-dont-build-scsi_dma_mapunmap-for-has_dma.patch drivers-scsi-small-cleanups.patch sym53c8xx_2-claims-cpqarray-device.patch drivers-scsi-wd33c93c-cleanups.patch make-seagate_st0x_detect-static.patch pci-error-recovery-symbios-scsi-base-support.patch pci-error-recovery-symbios-scsi-first-failure.patch drivers-scsi-pcmcia-nsp_csc-remove-kernel-24-code.patch drivers-message-i2o-devicec-remove-redundant-gfp_atomic-from-kmalloc.patch drivers-scsi-aic7xxx_oldc-remove-redundant-gfp_atomic-from-kmalloc.patch use-menuconfig-objects-ii-scsi.patch remove-dead-references-to-module_parm-macro.patch ppa-coding-police-and-printk-levels.patch remove-the-dead-cyberstormiii_scsi-option.patch config_scsi_fd_8xx-no-longer-exists.patch use-mutex-instead-of-semaphore-in-megaraid-mailbox-driver.patch
Quoted 1 line
Sent to James.
Care to drop the patches James NACKed every single time?
Andrew Morton
maintainerRe: scsi, was Re: -mm merge plans for 2.6.23
Quoted 20 lines · On Wed, 11 Jul 2007 13:37:18 +0200 Christoph Hellwig <[email protected]> wrote:
Quoted 20 lines
restore-acpi-change-for-scsi.patch git-scsi-misc-vs-greg-sysfs-stuff.patch aacraid-rename-check_reset.patch scsi-dont-build-scsi_dma_mapunmap-for-has_dma.patch drivers-scsi-small-cleanups.patch sym53c8xx_2-claims-cpqarray-device.patch drivers-scsi-wd33c93c-cleanups.patch make-seagate_st0x_detect-static.patch pci-error-recovery-symbios-scsi-base-support.patch pci-error-recovery-symbios-scsi-first-failure.patch drivers-scsi-pcmcia-nsp_csc-remove-kernel-24-code.patch drivers-message-i2o-devicec-remove-redundant-gfp_atomic-from-kmalloc.patch drivers-scsi-aic7xxx_oldc-remove-redundant-gfp_atomic-from-kmalloc.patch use-menuconfig-objects-ii-scsi.patch remove-dead-references-to-module_parm-macro.patch ppa-coding-police-and-printk-levels.patch remove-the-dead-cyberstormiii_scsi-option.patch config_scsi_fd_8xx-no-longer-exists.patch use-mutex-instead-of-semaphore-in-megaraid-mailbox-driver.patch
Quoted 3 lines
Quoted 1 line
Sent to James.
Care to drop the patches James NACKed every single time?
I'm not aware of any which fit that description.
There may be a couple in there which fix real bugs in an unapproved way. But I keep such patches as a matter of policy, so people keep on getting pestered about their bugs.
Re: buffered write patches, -mm merge plans for 2.6.23
In reply to Andrew MortonQuoted 1 line
pagefault-in-write deadlock fixes. Will hold for 2.6.24.
Why that? This stuff has been in forever and is needed at various levels. We need this in for anything to move forward on the buffered write front.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Andrew Morton
maintainerRe: buffered write patches, -mm merge plans for 2.6.23
Quoted 3 lines · On Wed, 11 Jul 2007 13:39:44 +0200 Christoph Hellwig <[email protected]> wrote:
Quoted 1 line
pagefault-in-write deadlock fixes. Will hold for 2.6.24.
Why that?
At Nick's request. More work is needed and the code hasn't had a lot of testing/thought/exposure/review.
Quoted 3 lines
This stuff has been in forever and is needed at various
levels. We need this in for anything to move forward on the buffered write front.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
x86 status was Re: -mm merge plans for 2.6.23
In reply to Andrew MortonQuoted 7 lines · Andrew Morton
revert-x86_64-mm-verify-cpu-rename.patch add-kstrndup-fix.patch
xen-build-fix.patch fix-x86_64-numa-fake-apicid_to_node-mapping-for-fake-numa-2.patch fix-x86_64-mm-xen-xen-smp-guest-support.patch more-fix-x86_64-mm-xen-xen-smp-guest-support.patch
Quoted 7 lines
fix-x86_64-mm-sched-clock-share.patch fix-x86_64-mm-xen-add-xen-virtual-block-device-driver.patch fix-x86_64-mm-add-common-orderly_poweroff.patch fix-x86_64-mm-xen-xen-event-channels.patch arch-i386-xen-mmuc-must-include-linux-schedh.patch tidy-up-usermode-helper-waiting-a-bit-fix.patch update-x86_64-mm-xen-use-iret-directly-where-possible.patch
Xen is probably going to be merged. I'm still not fully happy about the review status of the drivers and xenbus, but there doesn't seem to be much value in delaying it further.
I'll consolidate the fixes and fixes-to-fixes.
These all need re-review:
Quoted 7 lines
i386-add-support-for-picopower-irq-router.patch make-arch-i386-kernel-setupcremapped_pgdat_init-static.patch arch-i386-kernel-i8253c-should-include-asm-timerh.patch make-arch-i386-kernel-io_apicctimer_irq_works-static-again.patch quicklist-support-for-x86_64.patch x86_64-extract-helper-function-from-e820_register_active_regions.patch x86_64-fix-e820_hole_size-based-on-address-ranges.patch
Quoted 8 lines
x86_64-acpi-disable-srat-when-numa-emulation-succeeds.patch x86_64-slit-fake-pxm-to-node-mapping-for-fake-numa-2.patch x86_64-numa-fake-apicid_to_node-mapping-for-fake-numa-2.patch x86-use-elfnoteh-to-generate-vsyscall-notes-fix.patch mmconfig-x86_64-i386-insert-unclaimed-mmconfig-resources.patch x86_64-fix-smp_call_function_single-return-value.patch x86_64-o_excl-on-dev-mcelog.patch x86_64-support-poll-on-dev-mcelog.patch
It's still not clear to me this is any useful. The current code can run a program on MCE which should be really fast enough for machine check handling.
Quoted 3 lines
i386-fix-machine-rebooting.patch
x86-fix-section-mismatch-warnings-in-mtrr.patch
x86_64-ratelimit-segfault-reporting-rate.patch
I think that one was bogus.
Quoted 9 lines
x86_64-pm_trace-support.patch make-alt-sysrq-p-display-the-debug-register-contents.patch i386-flush_tlb_kernel_range-add-reference-to-the-arguments.patch round_jiffies-for-i386-and-x86-64-non-critical-corrected-mce-polling.patch pci-disable-decode-of-io-memory-during-bar-sizing.patch mmconfig-validate-against-acpi-motherboard-resources.patch x86_64-irq-check-remote-irr-bit-before-migrating-level-triggered-irq-v3.patch i386-remove-support-for-the-rise-cpu.patch
Quoted 7 lines
i386-make-arch-i386-mm-pgtablecpgd_cdtor-static.patch i386-fix-section-mismatch-warning-in-intel_cacheinfo.patch i386-do-not-restore-reserved-memory-after-hibernation.patch paravirt-helper-to-disable-all-io-space-fix.patch dmi_match-patch-in-rebootc-for-sff-dell-optiplex-745-fixes-hang.patch i386-hpet-check-if-the-counter-works.patch i386-trim-memory-not-covered-by-wb-mtrrs.patch
Might need more testing?
More review:
Quoted 43 lines
kprobes-x86_64-fix-for-mark-ro-data.patch kprobes-i386-fix-for-mark-ro-data.patch divorce-config_x86_pae-from-config_highmem64g.patch remove-unneeded-test-of-task-in-dump_trace.patch i386-move-the-kernel-to-16mb-for-numa-q.patch i386-show-unhandled-signals.patch i386-minor-nx-handling-adjustment.patch x86-smp-alt-once-option-is-only-useful-with-hotplug_cpu.patch x86-64-remove-unused-variable-maxcpus.patch move-functions-declarations-to-header-file.patch x86_64-during-vm-oom-condition.patch i386-during-vm-oom-condition.patch x86-64-disable-the-gart-in-shutdown.patch x86_84-move-iommu-declaration-from-proto-to-iommuh.patch i386-uaccessh-replace-hard-coded-constant-with-appropriate-macro-from-kernelh.patch i386-add-cpu_relax-to-cmos_lock.patch x86_64-flush_tlb_kernel_range-warning-fix.patch x86_64-add-ioapic-nmi-support.patch x86_64-change-_map_single-to-static-in-pci_gartc-etc.patch x86_64-geode-hw-random-number-generator-depend-on-x86_3.patch x86_64-fix-wrong-comment-regarding-set_fixmap.patch arch-x86_64-kernel-processc-lower-printk-severity.patch nohz-fix-nohz-x86-dyntick-idle-handling.patch acpi-move-timer-broadcast-and-pmtimer-access-before-c3-arbiter-shutdown.patch clockevents-fix-typo-in-acpi_pmc.patch timekeeping-fixup-shadow-variable-argument.patch timerc-cleanup-recently-introduced-whitespace-damage.patch clockevents-remove-prototypes-of-removed-functions.patch clockevents-fix-resume-logic.patch clockevents-fix-device-replacement.patch tick-management-spread-timer-interrupt.patch highres-improve-debug-output.patch hrtimer-speedup-hrtimer_enqueue.patch pcspkr-use-the-global-pit-lock.patch ntp-move-the-cmos-update-code-into-ntpc.patch i386-pit-stop-only-when-in-periodic-or-oneshot-mode.patch i386-remove-volatile-in-apicc.patch i386-hpet-assumes-boot-cpu-is-0.patch i386-move-pit-function-declarations-and-constants-to-correct-header-file.patch x86_64-untangle-asm-hpeth-from-asm-timexh.patch x86_64-use-generic-cmos-update.patch x86_64-remove-dead-code-and-other-janitor-work-in-tscc.patch x86_64-fix-apic-typo.patch
Quoted 8 lines
x86_64-convert-to-cleckevents.patch acpi-remove-the-useless-ifdef-code.patch x86_64-hpet-restore-vread.patch x86_64-restore-restore-nohpet-cmdline.patch x86_64-block-irq-balancing-for-timer.patch x86_64-prep-idle-loop-for-dynticks.patch x86_64-enable-high-resolution-timers-and-dynticks.patch x86_64-dynticks-disable-hpet_id_legsup-hpets.patch
I'm sceptical about the dynticks code. It just rips out the x86-64 timing code completely, which needs a lot more review and testing. Probably not .23
More review:
Quoted 12 lines
xen-fix-x86-config-dependencies.patch x86_64-get-mp_bus_to_node-as-early.patch xen-suppress-abs-symbol-warnings-for-unused-reloc-pointers.patch xen-cant-support-numa-yet.patch x86-fix-iounmaps-use-of-vm_structs-size-field.patch arch-x86_64-kernel-aperturec-lower-printk-severity.patch arch-x86_64-kernel-e820c-lower-printk-severity.patch ich-force-hpet-make-generic-time-capable-of-switching-broadcast-timer.patch ich-force-hpet-restructure-hpet-generic-clock-code.patch ich-force-hpet-ich7-or-later-quirk-to-force-detect-enable.patch ich-force-hpet-late-initialization-of-hpet-after-quirk.patch ich-force-hpet-ich5-quirk-to-force-detect-enable.patch
Quoted 8 lines
ich-force-hpet-ich5-fix-a-bug-with-suspend-resume.patch ich-force-hpet-add-ich7_0-pciid-to-quirk-list.patch geode-basic-infrastructure-support-for-amd-geode-class.patch geode-mfgpt-support-for-geode-class-machines.patch geode-mfgpt-clock-event-device-support.patch i386-x86_64-insert-hpet-firmware-resource-after-pci-enumeration-has-completed.patch i386-ioapic-remove-old-irq-balancing-debug-cruft.patch i386-deactivate-the-test-for-the-dead-config_debug_page_type.patch
-Andi
Re: x86 status was Re: -mm merge plans for 2.6.23
Quoted 3 lines
Quoted 1 line
i386-trim-memory-not-covered-by-wb-mtrrs.patch
Might need more testing?
For the mtrr trim patch at least, I think the coverage we've received in -mm is probably sufficient (the failure mode would be fairly obvious). The only thing I'm nervous about is adding AMD support for the quirk, since I don't have any way of testing it. We can easily add that later though, if a tester steps forward or we see demand for it (should just be an extra conditional in the trim code).
Thanks,
Jesse
Re: x86 status was Re: -mm merge plans for 2.6.23
In reply to Andi KleenQuoted 28 lines · Andi Kleen
Quoted 19 lines
clockevents-fix-typo-in-acpi_pmc.patch timekeeping-fixup-shadow-variable-argument.patch timerc-cleanup-recently-introduced-whitespace-damage.patch clockevents-remove-prototypes-of-removed-functions.patch clockevents-fix-resume-logic.patch clockevents-fix-device-replacement.patch tick-management-spread-timer-interrupt.patch highres-improve-debug-output.patch hrtimer-speedup-hrtimer_enqueue.patch pcspkr-use-the-global-pit-lock.patch ntp-move-the-cmos-update-code-into-ntpc.patch i386-pit-stop-only-when-in-periodic-or-oneshot-mode.patch i386-remove-volatile-in-apicc.patch i386-hpet-assumes-boot-cpu-is-0.patch i386-move-pit-function-declarations-and-constants-to-correct-header-file.patch x86_64-untangle-asm-hpeth-from-asm-timexh.patch x86_64-use-generic-cmos-update.patch x86_64-remove-dead-code-and-other-janitor-work-in-tscc.patch x86_64-fix-apic-typo.patch
Quoted 8 lines
x86_64-convert-to-cleckevents.patch acpi-remove-the-useless-ifdef-code.patch x86_64-hpet-restore-vread.patch x86_64-restore-restore-nohpet-cmdline.patch x86_64-block-irq-balancing-for-timer.patch x86_64-prep-idle-loop-for-dynticks.patch x86_64-enable-high-resolution-timers-and-dynticks.patch x86_64-dynticks-disable-hpet_id_legsup-hpets.patch
Quoted 3 lines
I'm sceptical about the dynticks code. It just rips out the x86-64 timing code completely, which needs a lot more review and testing. Probably not .23
What you just did here is a slap in the face to a lot of contributors who worked hard on this code :(
Let me tell you about the history of this project first. Arjan wrote the first version of it a year ago, and it was added to -rt and tested there by many people and went through many iterations and fixes. Chris Wright then created a x86_64 clockevents cleanup and dynticks enabling patchset from it this spring and sent it to lkml three and a half months ago, on March 31:
http://lwn.net/Articles/229094/
Thomas, the high resolution timers and clockevents maintainer, immediately picked up Chris' splitup/splitout/cleanup work and fixed and extended it, and sent a first cut to lkml on May 6th:
http://lwn.net/Articles/233226/
Thomas then sent an updated version of the x86_64 clockevents cleanup and dynticks code to lkml (on June 10th), for a second round of review:
http://lwn.net/Articles/237687/
As Thomas stated it in his submission:
" The patch set has been tested in the -hrt and -rt trees for quite a
while and the initial problems have been sorted out. Thanks to the folks from the PowerTop project for testing and feedback. "
Then on June 16th Thomas sent the third series:
http://lwn.net/Articles/238834/
(which too was in -rt and was tested there on numerous machines. It was also added to -mm.)
Then on June 23rd Thomas sent the fourth series of the x86_64 clockevents and dynticks code:
http://lwn.net/Articles/239620/
We finally have someone (Thomas) with core kernel clue who actually _cares_ about the x86 time code and does not see it as an ugly chore, one who collects the right patches and maintains the -hrt tree and co-maintains the -rt tree and interacts with other contributors. What he did was _hard_ to do but we are making really good progress:
http://lkml.org/lkml/2007/7/5/242
" All in all, personally I'm very happy to see Linux making such a
huge step forward with tickless and can't wait for this step to be available in all distros and for all architectures... "
Yes, touching the time code is a pain because both the hardware and the kernel has skeletons hidden in the closet, but we are mapping them one by one, and we already fixed several kernel skeletons in the process. The code is in -mm and there is no open regression related to this queue of patches at the moment.
But what is curiously absent from all this positive and dynamic activity around these patches on lkml? There is not a single email from Andi Kleen, the official maintainer of the x86_64 tree directly reacting to this submission in any way, shape or form. Not a single email from you thanking Arjan, Chris and Thomas for this amount of cleanup to the architecture you are maintaining:
31 files changed, 698 insertions(+), 1367 deletions(-)
Not a single email from you reviewing the patchset in any meaningful way. Not a single email from you to indicate that you even did so much as boot into this patchset.
What contribution do we have from you instead? A week before the .23 merge window is closed, in the very last possible moment, we finally get your first reaction to this patchset, albeit in the form of three terse sentences:
Quoted 3 lines
I'm sceptical about the dynticks code. It just rips out the x86-64 timing code completely, which needs a lot more review and testing. Probably not .23
In the past 3+ months there was not a single email from you indicating that you are "doubtful" about this submission, and that you think that it needs "lot more review and testing". You dont offer any alternative, you dont offer any feedback, no review, no testing, no support, just a simple rejection on lkml that prevents this project from going upstream.
Yes, maintainers have veto power and often have to make hard decisions, but, and let me stress this properly:
Only if they actually act as honest maintainers!
Altogether 197 emails on lkml discussed these patches, and you were Cc:-ed to every one of them. Over a dozen kernel developers reviewed it or reacted to the patchset in one way or another. And your only reaction to this is silence and a rejection claiming that it needs "lot more review"? I'm utterly speechless.
Ingo
Re: x86 status was Re: -mm merge plans for 2.6.23
Quoted 31 lines · On Wed, 11 Jul 2007 19:42:52 +0200 Ingo Molnar wrote:
Quoted 28 lines · Andi Kleen
Quoted 27 lines
clockevents-fix-typo-in-acpi_pmc.patch timekeeping-fixup-shadow-variable-argument.patch timerc-cleanup-recently-introduced-whitespace-damage.patch clockevents-remove-prototypes-of-removed-functions.patch clockevents-fix-resume-logic.patch clockevents-fix-device-replacement.patch tick-management-spread-timer-interrupt.patch highres-improve-debug-output.patch hrtimer-speedup-hrtimer_enqueue.patch pcspkr-use-the-global-pit-lock.patch ntp-move-the-cmos-update-code-into-ntpc.patch i386-pit-stop-only-when-in-periodic-or-oneshot-mode.patch i386-remove-volatile-in-apicc.patch i386-hpet-assumes-boot-cpu-is-0.patch i386-move-pit-function-declarations-and-constants-to-correct-header-file.patch x86_64-untangle-asm-hpeth-from-asm-timexh.patch x86_64-use-generic-cmos-update.patch x86_64-remove-dead-code-and-other-janitor-work-in-tscc.patch x86_64-fix-apic-typo.patch
x86_64-convert-to-cleckevents.patch acpi-remove-the-useless-ifdef-code.patch x86_64-hpet-restore-vread.patch x86_64-restore-restore-nohpet-cmdline.patch x86_64-block-irq-balancing-for-timer.patch x86_64-prep-idle-loop-for-dynticks.patch x86_64-enable-high-resolution-timers-and-dynticks.patch x86_64-dynticks-disable-hpet_id_legsup-hpets.patch
Quoted 8 lines
Quoted 3 lines
I'm sceptical about the dynticks code. It just rips out the x86-64 timing code completely, which needs a lot more review and testing. Probably not .23
What you just did here is a slap in the face to a lot of contributors who worked hard on this code :(
Let me tell you about the history of this project first.
... [lwn.net articles and other quotes snipped]
Quoted 8 lines
But what is curiously absent from all this positive and dynamic activity around these patches on lkml? There is not a single email from Andi Kleen, the official maintainer of the
x86_64tree directly reacting to this submission in any way, shape or form. Not a single email from you thanking Arjan, Chris and Thomas for this amount of cleanup to the architecture you are maintaining:31 files changed, 698 insertions(+), 1367 deletions(-)
Hm, I don't usually get thanks emails. Do other people?
Quoted 22 lines
Not a single email from you reviewing the patchset in any meaningful way. Not a single email from you to indicate that you even did so much as boot into this patchset.
What contribution do we have from you instead? A week before the .23 merge window is closed, in the very last possible moment, we finally get your first reaction to this patchset, albeit in the form of three terse sentences:
Quoted 3 lines
I'm sceptical about the dynticks code. It just rips out the x86-64 timing code completely, which needs a lot more review and testing. Probably not .23
In the past 3+ months there was not a single email from you indicating that you are "doubtful" about this submission, and that you think that it needs "lot more review and testing". You dont offer any alternative, you dont offer any feedback, no review, no testing, no support, just a simple rejection on lkml that prevents this project from going upstream.
Yes, maintainers have veto power and often have to make hard decisions, but, and let me stress this properly:
Quoted 7 lines
Only if they actually act as honest maintainers!
Altogether 197 emails on lkml discussed these patches, and you were Cc:-ed to every one of them. Over a dozen kernel developers reviewed it or reacted to the patchset in one way or another. And your only reaction to this is silence and a rejection claiming that it needs "lot more review"? I'm utterly speechless.
I can understand being disappointed, but not quite as upset as you appear to be.
so have you (Ingo) reviewed the ext4 patches? or reiser4 patches? or lumpy reclaim? or anti-fragmentation?
I certainly haven't. I can barely keep up with reading about 1/2 of lkml emails. And in my non-scientific method, I think that we are suffering from both (a) more patch submittals and (b) fewer qualified reviewers (per kernel KLOC) than we had 3-5 years ago.
I don't see how you can expect Andrew to review these or any other specific patchset. Do you have some suggestions on how to clone Andrew?
---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
Re: x86 status was Re: -mm merge plans for 2.6.23
Randy,
Quoted 8 lines · Randy Dunlap
I certainly haven't. I can barely keep up with reading about 1/2 of lkml emails. And in my non-scientific method, I think that we are suffering from both (a) more patch submittals and (b) fewer qualified reviewers (per kernel KLOC) than we had 3-5 years ago.
I don't see how you can expect Andrew to review these or any other specific patchset. Do you have some suggestions on how to clone Andrew?
Ingo was talking to Andi, the x86_64 maintainer, not to Andrew.
And I share his opinion that the maintainer of the subsystem, which is affected by such a fundamental patch, could have at least shown any public sign of interest, disgust, comment or what ever in a 3+ month time frame.
Especially about a patch, which is a logical consequence of an almost two years public and transparent effort to consolidate the time code in the kernel.
I for my part have no problem maintaining the set for another round out of tree and weed out eventually problems in -mm, but my expectation for qualified response of the responsible maintainer is exactly zero right now.
Thanks,
tglx
Re: x86 status was Re: -mm merge plans for 2.6.23
Quoted 8 lines · On Wed, 11 Jul 2007 23:39:19 +0200 Thomas Gleixner wrote:
Randy,
Quoted 5 lines · Randy Dunlap
I certainly haven't. I can barely keep up with reading about 1/2 of lkml emails. And in my non-scientific method, I think that we are suffering from both (a) more patch submittals and (b) fewer qualified reviewers (per kernel KLOC) than we had 3-5 years ago.
Quoted 5 lines
Quoted 3 lines
I don't see how you can expect Andrew to review these or any other specific patchset. Do you have some suggestions on how to clone Andrew?
Ingo was talking to Andi, the
x86_64maintainer, not to Andrew.
Yep, I see that when I re-read it. I apologize.
---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
Re: x86 status was Re: -mm merge plans for 2.6.23
In reply to Ingo MolnarWell I spent a lot of time making the x86-64 timing code work well on a variety of machines; working around a wide variety of hardware and platform bugs. I obviously don't agree on your description of its maintenance state.
Quoted 1 line
What contribution do we have from you instead? A week before the .23
I told him my objections privately earlier. Basically i would like to see an actually debuggable step-by-step change, not a rip everything out.
If that isn't possible it needs very careful review which just hasn't happened yet. But I'm not convinced even step by step is not possible here.
I thought it was clear that rip everything out is rarely a good idea in Linux land? That's really not something I should need to harp on repeatedly.
-Andi
Re: x86 status was Re: -mm merge plans for 2.6.23
Andi,
Quoted 5 lines · Andi Kleen
Quoted 1 line
What contribution do we have from you instead? A week before the .23
I told him my objections privately earlier. Basically i would like to see an actually debuggable step-by-step change, not a rip everything out.
You promised privately to do a thorough review as well, which I'm still waiting for since months.
Quoted 3 lines
If that isn't possible it needs very careful review which just hasn't happened yet. But I'm not convinced even step by step is not possible here.
There is no step by step thing. You convert an arch to clock events or you convert it not.
Quoted 3 lines
I thought it was clear that rip everything out is rarely a good idea in Linux land? That's really not something I should need to harp on repeatedly.
If you have technical objections, put them on the table. Point by point.
All I heard so far from you are platitudes, which are not worth the electrons to transport them.
tglx
Re: x86 status was Re: -mm merge plans for 2.6.23
Quoted 6 lines · * Thomas Gleixner ([email protected]) wrote:
Quoted 3 lines
If that isn't possible it needs very careful review which just hasn't happened yet. But I'm not convinced even step by step is not possible here.
There is no step by step thing. You convert an arch to clock events or you convert it not.
Indeed, about the only thing can be done is to take a slower approach to converging the arch specific implementations (hpet, pit, etc).
thanks,
-chris
Re: x86 status was Re: -mm merge plans for 2.6.23
In reply to Thomas GleixnerQuoted 11 lines · Thomas Gleixner
Andi,
Quoted 5 lines · Andi Kleen
Quoted 1 line
What contribution do we have from you instead? A week before the .23
I told him my objections privately earlier. Basically i would like to see an actually debuggable step-by-step change, not a rip everything out.
You promised privately to do a thorough review as well, which I'm still waiting for since months.
I did some reviewing, but never the big write up and feedback. That was my fault, sorry.
-Andi
Re: x86 status was Re: -mm merge plans for 2.6.23
In reply to Andi KleenHi Andi,
Quoted 3 lines · Andi Kleen
I thought it was clear that rip everything out is rarely a good idea in Linux land? That's really not something I should need to harp on repeatedly.
I'm going to change topic big time because your sentence above perfectly applies to the O(1) scheduler too. It's not like process schedulers are sacred and there shall be only one, while I/O schedulers and packet schedulers are profane and there can be many of them. FWIW IMHO the right way would have been to make the new scheduler pluggable and switchable at runtime, too bad it was ripped off instead. The difficulty of making the scheduler pluggable isn't really enormous, there have been patches floating around to achieve it, some I even deal with them myself once.
The only positive side of being forced to CFS I can imagine, is that more testing will make it more stable and more tuned more quickly. But I'm fairly certain Ingo's good enough to achieve without it, perhaps with a few more weeks.
Personally I very much like the unfariness of O(1), I'm afraid CFS will overschedule under a certain number of workloads in its attempt to provide a complete fair queieing at all costs, and it won't deal with the X server as nicely as O(1), but I may as well be wrong. The only thing I'm more sure about is that the computational complexity is higher, and that reason alone is a good technical reason to provide both and let the java folks stick with O(1) if they want.
Re: x86 status was Re: -mm merge plans for 2.6.23
Quoted 3 lines · Andrea Arcangeli
I'm going to change topic big time because your sentence above perfectly applies to the O(1) scheduler too.
I disagree to a large degree.
We almost never have problems with code you can "think about".
Sure, bugs happen, but code that everybody runs the same generally doesn't break. So a CPU scheduler doesn't worry me all that much. CPU schedulers are "easy".
What worries me is interfaces to hardware that we know looks different for different people. That means that any testing that one person has done doesn't necessarily translate to anything at *all* on another persons machine.
The timer problems we had when merging the stuff in 2.6.21 just scarred me. I'd _really_ hate to have to go through that again. And no, the "gradual" thing where the patch that actually *enables* something isn't very gradual at all, so that's the absolutely worst kind of thing, because then people can "git bisect" to the point where it got enabled and tell us that's where things broke, but that doesn't actually say anything at all about the patch that actually implements the new behaviour.
So the "enable" kind of patch is actually the worst of the lot, when it comes to hardware.
When it comes to pure software algorithms, and things like schedulers, you'll still obviously have timing issues and tuning, but generally things *work*, which makes it a lot easier to debug and describe.
Linus
Re: x86 status was Re: -mm merge plans for 2.6.23
* Linus Torvalds "Wed, 11 Jul 2007 15:09:28 -0700 (PDT)"
Quoted 27 lines · Andrea Arcangeli
Quoted 3 lines
I'm going to change topic big time because your sentence above perfectly applies to the O(1) scheduler too.
I disagree to a large degree.
We almost never have problems with code you can "think about".
Sure, bugs happen, but code that everybody runs the same generally doesn't break. So a CPU scheduler doesn't worry me all that much. CPU schedulers are "easy".
What worries me is interfaces to hardware that we know looks different for different people. That means that any testing that one person has done doesn't necessarily translate to anything at *all* on another persons machine.
The timer problems we had when merging the stuff in 2.6.21 just scarred me. I'd _really_ hate to have to go through that again. And no, the "gradual" thing where the patch that actually *enables* something isn't very gradual at all, so that's the absolutely worst kind of thing, because then people can "git bisect" to the point where it got enabled and tell us that's where things broke, but that doesn't actually say anything at all about the patch that actually implements the new behaviour.
Quoted 8 lines
So the "enable" kind of patch is actually the worst of the lot, when it comes to hardware.
When it comes to pure software algorithms, and things like schedulers, you'll still obviously have timing issues and tuning, but generally things *work*, which makes it a lot easier to debug and describe.
Linus
Seconded (obviously).
--
-o--=O`C
#oo'L O
<___=E M
Re: x86 status was Re: -mm merge plans for 2.6.23
In reply to Linus TorvaldsHi,
Quoted 3 lines · Linus Torvalds
Sure, bugs happen, but code that everybody runs the same generally doesn't break. So a CPU scheduler doesn't worry me all that much. CPU schedulers are "easy".
A little more advance warning wouldn't have hurt though.
The new scheduler does _a_lot_ of heavy 64 bit calculations without any attempt to scale that down a little...
One can blame me now for not having it brought up earlier, but discussions with Ingo are not something I'm looking forward to. :(
bye, Roman
Andrew Morton
maintainerRe: x86 status was Re: -mm merge plans for 2.6.23
Quoted 8 lines · On Fri, 13 Jul 2007 04:23:43 +0200 (CEST) Roman Zippel <[email protected]>…
Hi,
Quoted 3 lines · Linus Torvalds
Sure, bugs happen, but code that everybody runs the same generally doesn't break. So a CPU scheduler doesn't worry me all that much. CPU schedulers are "easy".
Quoted 6 lines
A little more advance warning wouldn't have hurt though.
The new scheduler does _a_lot_ of heavy 64 bit calculations without any attempt to scale that down a little...
One can blame me now for not having it brought up earlier, but discussions with Ingo are not something I'm looking forward to. :(
I brought that up a couple of weeks ago, got handwaved at and gave up.
It still isn't obvious to me that all that arith needs to be 64-bit on 32-bit machines, or even on 64-bit. 4e9 is a big number.
Re: x86 status was Re: -mm merge plans for 2.6.23
In reply to Roman ZippelQuoted 1 line · Roman Zippel
Hi,
Hi,
Quoted 2 lines
The new scheduler does _a_lot_ of heavy 64 bit calculations without any attempt to scale that down a little...
See prio_to_weight[], prio_to_wmult[] and sysctl_sched_stat_granularity. Perhaps more can be done, but "without any attempt..." isn't accurate.
-Mike
Re: x86 status was Re: -mm merge plans for 2.6.23
Hi,
Quoted 5 lines · Mike Galbraith
Quoted 2 lines
The new scheduler does _a_lot_ of heavy 64 bit calculations without any attempt to scale that down a little...
See prio_to_weight[], prio_to_wmult[] and
sysctl_sched_stat_granularity. Perhaps more can be done, but "without any attempt..." isn't accurate.
Calculating these values at runtime would have been completely insane, the alternative would be a crummy approximation, so using a lookup table is actually a good thing. That's not the problem.
BTW could someone please verify the prio_to_wmult table, especially [16] and [21] look a little off, like a digit was cut off.
While I'm at this, the 10% scaling there looks a little much (unless there are other changes I haven't looked at yet), the old code used more like 5%. This would mean a prio -20 task would get 98.86% cpu time compared to a prio 0 task, that was previously about the difference between -20 and 19 (and it would have previously gotten only 88.89%), now a prio -20 task would get 99.98% cpu time compared to a prio 19 task.
The individual levels are unfortunately not that easily comparable, but at the overall scale the change looks IMHO a little drastic.
bye, Roman
PATCH 1/1 CFS: Fix missing digit off in wmult table
Roman Zippel noticed inconsistency of the wmult table.
wmult[16] has a missing digit.
kernel/sched.c +1 -1
@@ -750,7 +750,7 @@ static const u32 prio_to_wmult[40] = {48356 ,60446 ,75558 ,94446 ,118058 ,147573 ,184467 ,230589 ,288233 ,360285 ,450347 ,562979 ,703746 ,879575 ,1099582 ,1374389 , -717986 ,2147483 ,2684354 ,3355443 ,4194304 , +1717986 ,2147483 ,2684354 ,3355443 ,4194304 ,5244160 ,6557201 ,8196502 ,10250518 ,12782640 ,16025997 ,19976592 ,24970740 ,31350126 ,39045157 , 49367440, 61356675, 76695844, 95443717, 119304647,
Re: [PATCH] CFS: Fix missing digit off in wmult table
Quoted 2 lines · Thomas Gleixner
Roman Zippel noticed inconsistency of the wmult table. wmult[16] has a missing digit.
[snip]
While we're at it, isn't the comment above the wmult table incorrect? The multiplier is 1.25, meaning a 25% change per nice level, not 10%.
- Jim
Re: [PATCH] CFS: Fix missing digit off in wmult table
Quoted 2 lines · James Bruce
While we're at it, isn't the comment above the wmult table incorrect? The multiplier is 1.25, meaning a 25% change per nice level, not 10%.
yes, the weight multiplier 1.25, but the actual difference in CPU utilization, when running two CPU intense tasks, is ~10%:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 8246 mingo 20 0 1576 244 196 R 55 0.0 0:11.96 loop 8247 mingo 21 1 1576 244 196 R 45 0.0 0:10.52 loop
so the first task 'wins' +10% CPU utilization (relative to the 50% it had before), the second task 'loses' -10% CPU utilization (relative to the 50% it had before).
so what the comment says is true:
* The "10% effect" is relative and cumulative: from _any_ nice level,
* if you go up 1 level, it's -10% CPU usage, if you go down 1 level
* it's +10% CPU usage.
for there to be a ~+10% change in CPU utilization for a task that races against another CPU-intense task there needs to be a ~25% change in the weight.
Ingo
Re: [PATCH] CFS: Fix missing digit off in wmult table
Quoted 18 lines · Ingo Molnar
Quoted 2 lines · James Bruce
While we're at it, isn't the comment above the wmult table incorrect? The multiplier is 1.25, meaning a 25% change per nice level, not 10%.
yes, the weight multiplier 1.25, but the actual difference in CPU utilization, when running two CPU intense tasks, is ~10%:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 8246 mingo 20 0 1576 244 196 R 55 0.0 0:11.96 loop 8247 mingo 21 1 1576 244 196 R 45 0.0 0:10.52 loopso the first task 'wins' +10% CPU utilization (relative to the 50% it had before), the second task 'loses' -10% CPU utilization (relative to the 50% it had before).
so what the comment says is true:
Quoted 7 lines
* The "10% effect" is relative and cumulative: from _any_ nice level,
* if you go up 1 level, it's -10% CPU usage, if you go down 1 level
* it's +10% CPU usage.for there to be a ~+10% change in CPU utilization for a task that races against another CPU-intense task there needs to be a ~25% change in the weight.
in any case more documentation is justified, so i've added some clarification to the comments - see the patch below.
Ingo
------------------------>
Subject: sched: improve weight-array comments
From: Ingo Molnar <[email protected]>
improve the comments around the wmult array (which controls the weight of niced tasks). Clarify that to achieve a 10% difference in CPU utilization, a weight multiplier of 1.25 has to be used.
--- kernel/sched.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
kernel/sched.c +3 -1
@@ -736,7 +736,9 @@ static void update_curr_load(struct rq ** * The "10% effect" is relative and cumulative: from _any_ nice level, * if you go up 1 level, it's -10% CPU usage, if you go down 1 level -* it's +10% CPU usage. +* it's +10% CPU usage. (to achieve that we use a multiplier of 1.25. +* If a task goes up by ~10% and another task goes down by ~10% then +* the relative distance between them is ~25%.) */ static const int prio_to_weight[40 ] = {/* -20 */ 88818 ,71054 ,56843 ,45475 ,36380 ,29104 ,23283 ,18626 ,14901 ,11921 ,
Re: [PATCH] CFS: Fix missing digit off in wmult table
Quoted 13 lines · Ingo Molnar
Quoted 12 lines · Ingo Molnar
Quoted 1 line · James Bruce
While we're at it, isn't the comment above the wmult table incorrect? The multiplier is 1.25, meaning a 25% change per nice level, not 10%.
yes, the weight multiplier 1.25, but the actual difference in CPU utilization, when running two CPU intense tasks, is ~10%:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 8246 mingo 20 0 1576 244 196 R 55 0.0 0:11.96 loop 8247 mingo 21 1 1576 244 196 R 45 0.0 0:10.52 loopso the first task 'wins' +10% CPU utilization (relative to the 50% it had before), the second task 'loses' -10% CPU utilization (relative to the 50% it had before).
so what the comment says is true:
Quoted 7 lines
Quoted 5 lines
* The "10% effect" is relative and cumulative: from _any_ nice level,
* if you go up 1 level, it's -10% CPU usage, if you go down 1 level
* it's +10% CPU usage.for there to be a ~+10% change in CPU utilization for a task that races against another CPU-intense task there needs to be a ~25% change in the weight.
in any case more documentation is justified, so i've added some clarification to the comments - see the patch below.
Ah ok so it's 10% of the original CPU usage, not relative to a tasks share from before. While I guess I still think in terms of relative CPU share, your comments now make sense to me. Thanks for the clarification.
- Jim
Quoted 28 lines
------------------------>
Subject: sched: improve weight-array comments
From: Ingo Molnar <[email protected]>improve the comments around the wmult array (which controls the weight of niced tasks). Clarify that to achieve a 10% difference in CPU utilization, a weight multiplier of 1.25 has to be used.
Signed-off-by Ingo Molnar <[email protected]>--- kernel/sched.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)Index:
linux/kernel/sched.c
===================================================================kernel/sched.c +3
-1@@ -736,7 +736,9 @@ static void update_curr_load(struct rq ** * The "10% effect" is relative and cumulative: from _any_ nice level, * if you go up 1 level, it's -10% CPU usage, if you go down 1 level -* it's +10% CPU usage. +* it's +10% CPU usage. (to achieve that we use a multiplier of 1.25. +* If a task goes up by ~10% and another task goes down by ~10% then +* the relative distance between them is ~25%.) */ static const int prio_to_weight[40 ] = {/* -20 */ 88818 ,71054 ,56843 ,45475 ,36380 ,29104 ,23283 ,18626 ,14901 ,11921 ,
Re: [PATCH] CFS: Fix missing digit off in wmult table
In reply to Ingo MolnarHi,
Quoted 10 lines · Ingo Molnar
yes, the weight multiplier 1.25, but the actual difference in CPU utilization, when running two CPU intense tasks, is ~10%:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 8246 mingo 20 0 1576 244 196 R 55 0.0 0:11.96 loop 8247 mingo 21 1 1576 244 196 R 45 0.0 0:10.52 loopso the first task 'wins' +10% CPU utilization (relative to the 50% it had before), the second task 'loses' -10% CPU utilization (relative to the 50% it had before).
As soon as you add another loop the difference changes again, while it's always correct to say it gets 25% more cpu time (which I still think is a little too much).
bye, Roman
Re: [PATCH] CFS: Fix missing digit off in wmult table
Quoted 7 lines · Roman Zippel
Quoted 7 lines
yes, the weight multiplier 1.25, but the actual difference in CPU utilization, when running two CPU intense tasks, is ~10%:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 8246 mingo 20 0 1576 244 196 R 55 0.0 0:11.96 loop 8247 mingo 21 1 1576 244 196 R 45 0.0 0:10.52 loop
Quoted 6 lines
Quoted 3 lines
so the first task 'wins' +10% CPU utilization (relative to the 50% it had before), the second task 'loses' -10% CPU utilization (relative to the 50% it had before).
As soon as you add another loop the difference changes again, while it's always correct to say it gets 25% more cpu time [...]
yep, and i'll add the relative effect to the comment too.
Ingo
Re: [PATCH] CFS: Fix missing digit off in wmult table
Hi,
Quoted 4 lines · Ingo Molnar
Quoted 2 lines
As soon as you add another loop the difference changes again, while it's always correct to say it gets 25% more cpu time [...]
yep, and i'll add the relative effect to the comment too.
Why did you cut off the rest of the sentence?
To illustrate the problem a little different: a task with a nice level -20 got around 700% more cpu time (or 8 times more), now it gets 8500% more cpu time (or 86.7 times more).
You don't think that change to the nice levels is a little drastic?
bye, Roman
Re: [PATCH] CFS: Fix missing digit off in wmult table
Quoted 8 lines · Roman Zippel
Quoted 4 lines · Ingo Molnar
Quoted 2 lines
As soon as you add another loop the difference changes again, while it's always correct to say it gets 25% more cpu time [...]
yep, and i'll add the relative effect to the comment too.
Why did you cut off the rest of the sentence?
(no need to become hostile, i answered to that portion of your sentence separately, which was logically detached from the other portion of your sentence. I marked the cut with the '[...]' sign. )
Quoted 4 lines
To illustrate the problem a little different: a task with a nice level -20 got around 700% more cpu time (or 8 times more), now it gets 8500% more cpu time (or 86.7 times more). You don't think that change to the nice levels is a little drastic?
This was discussed on lkml in detail, see the CFS threads. It has been a common request for nice levels to be more logical (i.e. to make them universal and to detach them from HZ) and for them to be more effective as well.
Ingo
Re: [PATCH] CFS: Fix missing digit off in wmult table
Hi,
Quoted 10 lines · Ingo Molnar
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
As soon as you add another loop the difference changes again, while it's always correct to say it gets 25% more cpu time [...]
yep, and i'll add the relative effect to the comment too.
Why did you cut off the rest of the sentence?
(no need to become hostile, i answered to that portion of your sentence separately, which was logically detached from the other portion of your sentence. I marked the cut with the '[...]' sign. )
Could you please stop with these accusations?
Could you please point me to the mail with the separate answer?
Quoted 6 lines
Quoted 4 lines
To illustrate the problem a little different: a task with a nice level -20 got around 700% more cpu time (or 8 times more), now it gets 8500% more cpu time (or 86.7 times more). You don't think that change to the nice levels is a little drastic?
This was discussed on lkml in detail, see the CFS threads.
Which are quite big, so I skipped most of it, a more precise pointer would be appreciated.
Quoted 4 lines
It has been a
common request for nice levels to be more logical (i.e. to make them universal and to detach them from HZ) and for them to be more effective as well.
Huh? What has this to do with HZ? The scheduler used ticks internally, but it's irrelevant to what the user sees via the nice levels.
So the question still stands that this change may be a little drastic, as you changed the nice levels of _all_ users, not just of those who were previously interested in CFS.
bye, Roman
Re: [PATCH] CFS: Fix missing digit off in wmult table
Quoted 6 lines · Roman Zippel
Quoted 3 lines
It has been a common request for nice levels to be more logical (i.e. to make them universal and to detach them from HZ) and for them to be more effective as well.
Huh? What has this to do with HZ? The scheduler used ticks internally, but it's irrelevant to what the user sees via the nice levels. [...]
unfortunately you are wrong again - there are various HZ related artifacts in the nice level support code of the old scheduler.
v2.6.22, CONFIG_HZ=100, nice +19 task against a nice-0 CPU-intense task:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 2446 mingo 25 0 1576 244 196 R 90.9 0.0 0:32.79 loop 2448 mingo 39 19 1580 248 196 R 9.1 0.0 0:02.94 loop
v2.6.22, CONFIG_HZ=250, nice +19 task against a nice-0 CPU-intense task:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 2358 mingo 25 0 1576 248 196 R 96.1 0.0 0:31.97 loop_silent 2363 mingo 39 19 1576 244 196 R 3.9 0.0 0:01.24 loop_silent
v2.6.22, CONFIG_HZ=300, nice +19 task against a nice-0 CPU-intense task:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 2332 mingo 25 0 1580 248 196 R 95.1 0.0 0:11.84 loop_silent 2335 mingo 39 19 1576 244 196 R 3.1 0.0 0:00.39 loop_silent
to sum it up: a nice +19 task (the most commonly used nice level in practice) gets 9.1%, 3.9%, 3.1% of CPU time on the old scheduler, depending on the value of HZ. This is quite inconsistent and illogical.
this HZ dependency of nice levels existed for many years, and the new scheduler solves that inconsistency - every nice level will get the same amount of time, regardless of HZ.
Ingo
Re: [PATCH] CFS: Fix missing digit off in wmult table
Hi,
Quoted 3 lines · Ingo Molnar
to sum it up: a nice +19 task (the most commonly used nice level in practice) gets 9.1%, 3.9%, 3.1% of CPU time on the old scheduler, depending on the value of HZ. This is quite inconsistent and illogical.
You're correct that you can find artifacts in the extreme cases, it's subjective whether this is a serious problem.
It's nice that these artifacts are gone, but that still doesn't explain why this ratio had to be increase that much from around 1:10 to 1:69.
bye, Roman
Re: [PATCH] CFS: Fix missing digit off in wmult table
Quoted 4 lines · Roman Zippel
Hi,
On Mon, 16 Jul 2007, Ingo Molnar wrote:
Quoted 8 lines
Quoted 3 lines
to sum it up: a nice +19 task (the most commonly used nice level in practice) gets 9.1%, 3.9%, 3.1% of CPU time on the old scheduler, depending on the value of HZ. This is quite inconsistent and illogical.
You're correct that you can find artifacts in the extreme cases, it's subjective whether this is a serious problem.
It's nice that these artifacts are gone, but that still doesn't explain why this ratio had to be increase that much from around 1:10 to 1:69.
More dynamic range is better? If you actually want a task to get 20x the CPU time of another, the older scheduler doesn't really allow it.
Getting 1/69th of a modern CPU is still a fair number of cycles. Nevermind 1/69th of a machine with > 64 cores.
Signature · 1 line
Mathematics is the supreme nostalgia of our time.
Re: [PATCH] CFS: Fix missing digit off in wmult table
Quoted 5 lines · Matt Mackall
More dynamic range is better? If you actually want a task to get 20x the CPU time of another, the older scheduler doesn't really allow it.
Getting 1/69th of a modern CPU is still a fair number of cycles. Nevermind 1/69th of a machine with > 64 cores.
yeah. furthermore, nice -20 is only admin-selectable.
Here are the current CPU-use values for positive nice levels:
nice 0: 100.00% nice 1: 80.00% nice 2: 64.10% nice 3: 51.28% nice 4: 40.98% nice 5: 32.78% nice 6: 26.24% nice 7: 21.00% nice 8: 16.77% nice 9: 13.42%
nice 10: 10.74%
nice 11: 8.59%
nice 12: 6.87%
nice 13: 5.50%
nice 14: 4.39%
nice 15: 3.51%
nice 16: 2.81%
nice 17: 2.25%
nice 18: 1.80%
nice 19: 1.44%
here's the CPU utilization table for negative nice levels (relative to a nice -20 task):
nice 0: 1.15%
nice -1: 1.44%
nice -2: 1.80%
nice -3: 2.25%
nice -4: 2.81%
nice -5: 3.51%
nice -6: 4.39%
nice -7: 5.50%
nice -8: 6.87%
nice -9: 8.59%
nice -10: 10.74%
nice -11: 13.42%
nice -12: 16.77%
nice -13: 21.00%
nice -14: 26.24%
nice -15: 32.78%
nice -16: 40.98%
nice -17: 51.28%
nice -18: 64.10%
nice -19: 80.00%
nice -20: 100.00%
these are pretty sane, and symmetric across the origo. Nice -20 is the odd one out, because there is no nice +20. But its value is still logical, it's the mirror image of an imaginery nice +20.
and note that even on the old scheduler, nice-0 was "3200% more powerful" than nice +19 (with CONFIG_HZ=300), and nice -19 was only 700% more powerful than nice-0. So not only was it inconsistent (and i can create scary numbers too ;), it gave the admin-controlled negative nice levels less of a punch than to user-controlled nice +19. A number of people complainted about that, and CFS addresses this.
in fact i like it that nice -20 has a slightly bigger punch than it used to have before: it might remove the need to run audio apps (and other multimedia apps) under SCHED_FIFO. (SCHED_FIFO is unprotected against lockups, while under CFS a nice 0 task is still starvation protected against a nice -20 task.)
furthermore, there is a quality of implementation issue as well, look at the definition of the nice system call:
asmlinkage long sys_nice(int increment)
the "increment" is relative. So nice(1) has the same behavioral effect under CFS, regardless of which nice level you start out from. Under the old scheduler, the result depended on which nice level you started out from.
Ingo
Re: [PATCH] CFS: Fix missing digit off in wmult table
Hi,
Quoted 2 lines · Ingo Molnar
and note that even on the old scheduler, nice-0 was "3200% more powerful" than nice +19 (with
CONFIG_HZ=300),
How did you get that value? At any HZ the ratio should be around 1:10 (+- rounding error).
Quoted 2 lines
in fact i like it that nice -20 has a slightly bigger punch than it used to have before:
"Slightly bigger"??? You're joking, right?
Especially the user levels are doing something completely different now, which may break user expectation. While the user couldn't expect anything precise, it's still a big difference whether a process at nice 5 gets 75% of the time or only 30%.
bye, Roman
Re: [PATCH] CFS: Fix missing digit off in wmult table
Quoted 9 lines · Roman Zippel
Hi,
Quoted 2 lines · Ingo Molnar
and note that even on the old scheduler, nice-0 was "3200% more powerful" than nice +19 (with
CONFIG_HZ=300),How did you get that value? At any HZ the ratio should be around 1:10 (+- rounding error).
you are wrong again. I sent you the numbers earlier today already:
| PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND | 2332 mingo 25 0 1580 248 196 R 95.1 0.0 0:11.84 loop | 2335 mingo 39 19 1576 244 196 R 3.1 0.0 0:00.39 loop
3.1% is 3067% more than 95.1%, and the ratio is 1:30.67. You again deny above that this is the case, and there's nothing i can do about your denial of facts - that is your own private problem.
Ingo
Re: [PATCH] CFS: Fix missing digit off in wmult table
Hi,
Quoted 14 lines · Ingo Molnar
Quoted 9 lines · Roman Zippel
Hi,
Quoted 2 lines · Ingo Molnar
and note that even on the old scheduler, nice-0 was "3200% more powerful" than nice +19 (with
CONFIG_HZ=300),How did you get that value? At any HZ the ratio should be around 1:10 (+- rounding error).
you are wrong again. I sent you the numbers earlier today already:
Quoted 7 lines
| PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND | 2332 mingo 25 0 1580 248 196 R 95.1 0.0 0:11.84 loop | 2335 mingo 39 19 1576 244 196 R 3.1 0.0 0:00.39 loop3.1% is 3067% more than 95.1%, and the ratio is 1:30.67. You again deny above that this is the case, and there's nothing i can do about your denial of facts - that is your own private problem.
Ingo, how am I supposed to react to this? I'm asking a simple question and I get this? I'm at serious loss how to deal with you. :-(
Above is based on theoritical values, for a 300HZ kernel these two processes should get 30 and 3 ticks. Should there be any rounding error or off by one error so that the processes get one tick less than they should get or one tick is accounted to the wrong process, my theoritical value is still within the possible error range and doesn't contradict your practical values.
Playing around with some other nice levels, confirms the theory that something is a little off, so I'm quite correct at saying that the ratio _should_ be 1:10.
OTOH you are the one who is wrong about me (again). :-(
bye, Roman
Re: [PATCH] CFS: Fix missing digit off in wmult table
Hi,
Quoted 3 lines · On Tue, 17 Jul 2007, I wrote:
Playing around with some other nice levels, confirms the theory that something is a little off, so I'm quite correct at saying that the ratio _should_ be 1:10.
Rechecking everything there was actually a small error in my test program, so the ratio should be at 1:20. Sorry about that mistake.
Nice level 19 shows the largest artifacts, as that level only gets a single tick, so the ratio is often 1:HZ/10 (except for 1000HZ where it's 5:100). Nevertheless it's still true that in general nice levels were independent of HZ (that's all I wanted to say a couple of mails ago).
Ingo, you can start now gloating, but contrary to you I have no problems with admitting mistakes and apologizing for them. The point is just that I'm reacting better to factual arguments instead of flames (and I think it's not just me), so I'm pretty sure I'm still correct about this:
Quoted 1 line
OTOH you are the one who is wrong about me (again). :-(
bye, Roman
Re: [PATCH] CFS: Fix missing digit off in wmult table
Quoted 3 lines · Roman Zippel
Nice level 19 shows the largest artifacts, as that level only gets a single tick, so the ratio is often 1:HZ/10 (except for 1000HZ where it's 5:100). [...]
Roman, please do me a favor, and ask me the following question:
" Ingo, you've been maintaining the scheduler for years. In fact you
wrote the old nice code we are talking about here. You changed it a number of times since then. So you really know what's going on here. Why does the old nice code behave like that for nice +19 levels? "
I've been waiting for that obvious question, and i _might_ be able to answer it, but somehow it never occured to you ;-) Thanks,
Ingo
Re: [PATCH] CFS: Fix missing digit off in wmult table
Hi,
Quoted 9 lines · Ingo Molnar
Roman, please do me a favor, and ask me the following question:
" Ingo, you've been maintaining the scheduler for years. In fact you
wrote the old nice code we are talking about here. You changed it a number of times since then. So you really know what's going on here. Why does the old nice code behave like that for nice +19 levels? "I've been waiting for that obvious question, and i _might_ be able to answer it, but somehow it never occured to you ;-) Thanks,
Do you have any idea how insulting and arrogant this is? Let me translate for you, how this arrived:
"O Ingo, who art our god of the scheduler. You have blessed the paths I walked in. You kept me from sinning numerous times. Your wisdom is infinite. Guide me on the journey that layeth ahead of me into this world knowledge of Your truth."
(I apologize already in advance, if I should have hurt anyones religious feelings.)
It's obvious that you have more experience with the scheduler code, but does that make you unfailable? Does that give you the right to act like a jerk?
I do make mistakes, I try to learn from them and life goes on, I have no problem with that, but what I have a problem with is if someone is abusing this to his own advantage. I have to be extremely carful what I say to you, because you jump on the first small mistake and I have to bear your insults like "there's nothing i can do about your denial of facts - that is your own private problem." I have no problems with facts, I'm only trying very hard to ignore your arrogant behaviour...
If you have something to contribute to this discussion which might clear things up, then just say it, but I'm not going to beg for it.
bye, Roman
Re: [PATCH] CFS: Fix missing digit off in wmult table
Quoted 11 lines · Roman Zippel
Quoted 9 lines · Ingo Molnar
Roman, please do me a favor, and ask me the following question:
" Ingo, you've been maintaining the scheduler for years. In fact you
wrote the old nice code we are talking about here. You changed it a number of times since then. So you really know what's going on here. Why does the old nice code behave like that for nice +19 levels? "I've been waiting for that obvious question, and i _might_ be able to answer it, but somehow it never occured to you ;-) Thanks,
[...]
Quoted 2 lines
It's obvious that you have more experience with the scheduler code, but does that make you unfailable? [...]
Roman, it is really not about 'experience', and yes, we all make frequent mistakes.
it's about the plain fact that i happened to write _both_ the old and the new code you were talking about all along. In this discussion about nice levels you were (very) agressively asserting things that were untrue, you were suggesting that i dont understand the code, instead of simply asking me why the code was written in such a way and what the motivation behind it was. I'd be glad to attempt to answer such a friendly question, if you are interested in asking it and if you are interested in my answer. Thanks,
Ingo
Re: [PATCH] CFS: Fix missing digit off in wmult table
Hi,
Quoted 8 lines · Ingo Molnar
Quoted 3 lines
Quoted 3 lines
Roman, please do me a favor, and ask me the following question:
[insult deleted]
In this discussion about
nice levels you were (very) agressively asserting things that were untrue,
Instead of simply asserting things, how about you provide some examples? I made so far a single mistake of mixing up nice levels 18 and 19. If you would point me to such examples, I could learn how to tone it down a little, since the nice levels are not the only issue I have with the new scheduler, the heavy stuff is still about to come. The problem here is there is too much burnt ground so I can't just present raw ideas, which get flamed by you, I have to be sufficiently confident they are valid, what you might then interpret as "agressive assertion".
Quoted 1 line
you were suggesting that i dont understand the code,
Again, please point me to examples, so I at least have a chance to clear things up, since it was never my intention to make such a suggestion, but this gives me no chance to defend myself.
OTOH I can tell you exactly how you continuously insult me, e.g. by suggesting I ask "stupid questions" or that I'm in "denial of facts". Don't make such suggestions if you have no idea how insulting they are. Especially the one deleted insult above where you have the impertinence to quote it, such tone is more appropriate between lord and inferior, where the latter have to make a request and the former "might" grant it. _Never_ make me beg. :-(
bye, Roman
Re: [PATCH] CFS: Fix missing digit off in wmult table
Quoted 5 lines · Roman Zippel
Don't make such suggestions if you have no idea how insulting they are. Especially the one deleted insult above where you have the impertinence to quote it, such tone is more appropriate between lord and inferior, where the latter have to make a request and the former "might" grant it. [...]
uhm, [and the uninterested reader might want to skip to the next mail ;-)], i'm really confused about your reply. Do you really mean this:
Quoted 9 lines
Quoted 9 lines
Roman, please do me a favor, and ask me the following question:
" Ingo, you've been maintaining the scheduler for years. In fact you
wrote the old nice code we are talking about here. You changed it a number of times since then. So you really know what's going on here. Why does the old nice code behave like that for nice +19 levels? "I've been waiting for that obvious question, and i _might_ be able to answer it, but somehow it never occured to you ;-) Thanks,
the ";-)" emoticon (and its contents) clearly signals this as a sarcastic, tongue-in-cheek remark. To make it even clearer, please re-read it with the <sarcastic> tag added as well for clarity:
Quoted 9 lines
Quoted 9 lines
<sarcastic>
Roman, please do me a favor, and ask me the following question:
" Ingo, you've been maintaining the scheduler for years. In fact you
wrote the old nice code we are talking about here. You changed it a number of times since then. So you really know what's going on here. Why does the old nice code behave like that for nice +19 levels? "
Quoted 4 lines
Quoted 4 lines
I've been waiting for that obvious question, and i _might_ be able to answer it, but somehow it never occured to you ;-) Thanks,
</sarcastic>
ok? (If you didnt see/read it as sarcastic straight away then my apologies for insulting you!)
The "_might_ be able to answer" bit is of course sarcastic too, and contrary to your (i have to say, pretty absurd) suggestion i did not suggest that i "might be _willing_ to answer" - which would be quite arrogant indeed and which i never said or suggested. To make it even
clearer: i'm definitely able to answer questions about code i wrote originally and which i just changed, were you to show genuine interest in hearing my opinion :-)
Ingo
Re: [PATCH] CFS: Fix missing digit off in wmult table
Hi,
Quoted 6 lines · Ingo Molnar
Quoted 3 lines
Quoted 3 lines
[more rude insults deleted]
I've been waiting for that obvious question, and i _might_ be able to answer it, but somehow it never occured to you ;-) Thanks,the ";-)" emoticon (and its contents) clearly signals this as a sarcastic, tongue-in-cheek remark.
To take another example why is this still insulting and inappropriate, this is a behaviour I would characterize as school bullying:
A bully attacks someone obviously weaker than himself and for example takes something away and than continues like "If you ask nicely I'll give it back to you.", this often accompied by laughter to signal he's enjoying himself and the power he has, but for the other person it's everything but funny.
Maybe you don't know what it feels like, but I do and I can't find anything funny, sarcastic or whatever about this, no matter how many smileys or other tags you add there. If the communication is already that troubled as this, such "humor" is really the worst thing you can do and I find it rather sad that you can't realize this yourself.
Quoted 2 lines
ok? (If you didnt see/read it as sarcastic straight away then my apologies for insulting you!)
Sorry, that is too little too late. You've apologized before and you continued to make fun of me personally to the point of spreading wrong information about me, which you could have very easily verified yourself, if you only wanted.
What I want from you is that you treat me with respect and to keep your "sarcasm" to yourself.
I told you very clearly how I think about you requoting this crap and yet you repeat it again _twice_, so on the one hand I get this apology attempt and on the other hand you continue to kick me in the crotch? How do you think am I supposed to feel about this?
It's also always interesting what you don't respond to. I asked you for examples which would prove the (rather strong) assertions you made about me, what does it tell me now if you can't back up your statements?
bye, Roman
Re: [PATCH] CFS: Fix missing digit off in wmult table
In reply to Matt MackallHi,
Quoted 5 lines · Matt Mackall
Quoted 2 lines
It's nice that these artifacts are gone, but that still doesn't explain why this ratio had to be increase that much from around 1:10 to 1:69.
More dynamic range is better? If you actually want a task to get 20x the CPU time of another, the older scheduler doesn't really allow it.
You can already have that, the complete range level from 19 to -20 was about 1:80.
There is also something like too much range, I tried it with top at 19 and as soon as something runs at -20 it's practically dead, because it gets now only 1/5900 of cpu time.
bye, Roman
Re: [PATCH] CFS: Fix missing digit off in wmult table
Quoted 10 lines · Roman Zippel
Quoted 7 lines
Quoted 3 lines
It's nice that these artifacts are gone, but that still doesn't explain why this ratio had to be increase that much from around 1:10 to 1:69.
More dynamic range is better? If you actually want a task to get 20x the CPU time of another, the older scheduler doesn't really allow it.
You can already have that, the complete range level from 19 to -20 was about 1:80.
But that is irrelevant: all tasks start out at nice 0, and what matters is the dynamic range around 0.
So the dynamic range has been made uniform in the positive from 1:10...1:20...1:30 to 1:69 for nice +19, and from 1:8 to 1:69 in the minus. (with 1:86 nice -20) If you look at the negative nice levels alone it's a substantial increase but if you compare it with positive nice levels you'll similar kinds of dynamic ranges were already present in the old scheduler and you'll see why we've done it.
Negative nice levels are admin-controlled, the increase in the negative levels is is not a big issue and people actually like the increased dynamic range and the consistency. The positive range _might_ be a bigger issue but there we were largely inconsistent anyway, and again, people like the increased dynamic range.
Ingo
Re: [PATCH] CFS: Fix missing digit off in wmult table
Hi,
Quoted 16 lines · Ingo Molnar
Quoted 10 lines · Roman Zippel
Quoted 7 lines
Quoted 3 lines
It's nice that these artifacts are gone, but that still doesn't explain why this ratio had to be increase that much from around 1:10 to 1:69.
More dynamic range is better? If you actually want a task to get 20x the CPU time of another, the older scheduler doesn't really allow it.
You can already have that, the complete range level from 19 to -20 was about 1:80.
But that is irrelevant: all tasks start out at nice 0, and what matters is the dynamic range around 0.
Quoted 6 lines
So the dynamic range has been made uniform in the positive from 1:10...1:20...1:30 to 1:69 for nice +19, and from 1:8 to 1:69 in the minus. (with 1:86 nice -20) If you look at the negative nice levels alone it's a substantial increase but if you compare it with positive nice levels you'll similar kinds of dynamic ranges were already present in the old scheduler and you'll see why we've done it.
So let's look at them:
for (i=0;i<20;i++) print i, " : ", (20-i)*5, " : ", 100*1.25^-i, " : ", e(l(2)*(-i/5))*100, "\n"; 0 : 100 : 100 : 100.00000000000000000000
1 : 95 : 80.00000000000000000000 : 87.05505632961241391300
2 : 90 : 64.00000000000000000000 : 75.78582832551990411700
3 : 85 : 51.20000000000000000000 : 65.97539553864471296900
4 : 80 : 40.96000000000000000000 : 57.43491774985175034000
5 : 75 : 32.76800000000000000000 : 50.00000000000000000000
6 : 70 : 26.21440000000000000000 : 43.52752816480620695700
7 : 65 : 20.97152000000000000000 : 37.89291416275995205900
8 : 60 : 16.77721600000000000000 : 32.98769776932235648400
9 : 55 : 13.42177280000000000000 : 28.71745887492587517000
10 : 50 : 10.73741824000000000000 : 25.00000000000000000000
11 : 45 : 8.58993459200000000000 : 21.76376408240310347800
12 : 40 : 6.87194767360000000000 : 18.94645708137997602900
13 : 35 : 5.49755813888000000000 : 16.49384888466117824200
14 : 30 : 4.39804651110400000000 : 14.35872943746293758500
15 : 25 : 3.51843720888320000000 : 12.50000000000000000000
16 : 20 : 2.81474976710656000000 : 10.88188204120155173900
17 : 15 : 2.25179981368524800000 : 9.47322854068998801400
18 : 10 : 1.80143985094819840000 : 8.24692444233058912100
19 : 5 : 1.44115188075855872000 : 7.17936471873146879200
(nice level : old % : new % : my suggested %)
Your levels divert very quickly from what they used to be (upto a factor of 7), it's also not really easy to remember what the individual levels mean.
I at least try to keep them somewhat in the range they used to be (and the difference is limited to a factor of about 2), also every 5 levels the amount of cpu time is halved, which is very easy to remember.
If you need more dynamic range, is there a law that prevents us from going beyond 19? For example:
for (i=20;i<=30;i++) print i, " : ", (20-i)*5, " : ", 100*1.25^-i, " : ", e(l(2)*(-i/5))*100, "\n"; 20 : 0 : 1.15292150460684697600 : 6.25000000000000000000
21 : -5 : .92233720368547758000 : 5.44094102060077586900
22 : -10 : .73786976294838206400 : 4.73661427034499400700
23 : -15 : .59029581035870565100 : 4.12346222116529456000
24 : -20 : .47223664828696452100 : 3.58968235936573439600
25 : -25 : .37778931862957161700 : 3.12500000000000000000
26 : -30 : .30223145490365729300 : 2.72047051030038793400
27 : -35 : .24178516392292583400 : 2.36830713517249700300
28 : -40 : .19342813113834066700 : 2.06173111058264728000
29 : -45 : .15474250491067253400 : 1.79484117968286719800
30 : -50 : .12379400392853802700 : 1.56250000000000000000
setpriority() accepts such values without error.
bye, Roman
Re: [PATCH] CFS: Fix missing digit off in wmult table
In reply to Roman ZippelQuoted 4 lines · Roman Zippel
To illustrate the problem a little different: a task with a nice level -20 got around 700% more cpu time (or 8 times more), now it gets 8500% more cpu time (or 86.7 times more).
Ingo, that _does_ sound excessive.
How about trying a much less aggressive nice-level (and preferably linear, not exponential)?
Linus
Re: [PATCH] CFS: Fix missing digit off in wmult table
Hi,
Quoted 2 lines · Linus Torvalds
How about trying a much less aggressive nice-level (and preferably linear, not exponential)?
I think the exponential increase isn't the problem. The old code did approximate something like this rather crudely with the result that there was a big gap between level 0 and -1.
Something like this:
echo 'for (i=-20;i<=20;i++) print i, " : ", 1024*e(l(2)*(-i/20*3)), "\n";' | bc -l
would produce a range similiar to the old code. Replacing the factor 3 with 4 would be IMO a more reasonable increase and had the advantage for the user that it's easier to understand that every 5 levels the time a process gets is doubled.
bye, Roman
Peter Zijlstra
maintainerRe: [PATCH] CFS: Fix missing digit off in wmult table
In reply to Linus TorvaldsQuoted 11 lines · Linus Torvalds
Quoted 4 lines · Roman Zippel
To illustrate the problem a little different: a task with a nice level -20 got around 700% more cpu time (or 8 times more), now it gets 8500% more cpu time (or 86.7 times more).
Ingo, that _does_ sound excessive.
How about trying a much less aggressive nice-level (and preferably linear, not exponential)?
I actually like the extra range, it allows for a much softer punch of background tasks even on somewhat slower boxen.
I've been testing CFS on my 1200 MHz lappy for some time and a strongly niced kbuild leaves a very usable system.
The old scheduler would leave the thing rather jumpy. And while CFS fully fixes the jumpyness, I just did a nice +13 (which should be equivalent to the old schedulers nice +19 for my HZ) and did a nice +19 kbuild and I can definitely feel the difference between them.
Early CFS versions had an pretty aggressive nice range (0.1% for +19), and that has been toned down based on feedback. The current levels seem to work well, at least on my boxen.
- Peter
Re: [PATCH] CFS: Fix missing digit off in wmult table
Hi,
Quoted 2 lines · Peter Zijlstra
I actually like the extra range, it allows for a much softer punch of background tasks even on somewhat slower boxen.
The extra range is not really a problem, in
http://www.ussg.iu.edu/hypermail/linux/kernel/0707.2/0850.html
I suggested how we can have both.
bye, Roman
Peter Zijlstra
maintainerRe: [PATCH] CFS: Fix missing digit off in wmult table
Quoted 4 lines · Roman Zippel
Hi,
On Wed, 18 Jul 2007, Peter Zijlstra wrote:
Quoted 8 lines
Quoted 2 lines
I actually like the extra range, it allows for a much softer punch of background tasks even on somewhat slower boxen.
The extra range is not really a problem, in
http://www.ussg.iu.edu/hypermail/linux/kernel/0707.2/0850.html
I suggested how we can have both.
By breaking the UNIX model of nice levels. Not an option in my book.
Re: [PATCH] CFS: Fix missing digit off in wmult table
Quoted 8 lines · Peter Zijlstra
Quoted 7 lines · Roman Zippel
Hi,
Quoted 2 lines · Peter Zijlstra
I actually like the extra range, it allows for a much softer punch of background tasks even on somewhat slower boxen.
Quoted 7 lines
Quoted 5 lines
The extra range is not really a problem, in
http://www.ussg.iu.edu/hypermail/linux/kernel/0707.2/0850.html
I suggested how we can have both.
By breaking the UNIX model of nice levels. Not an option in my book.
yeah, that's pretty much out of question.
Ingo
Re: [PATCH] CFS: Fix missing digit off in wmult table
In reply to Peter ZijlstraHi,
Quoted 1 line · Peter Zijlstra
By breaking the UNIX model of nice levels. Not an option in my book.
Breaking user expectations of nice levels is?
bye, Roman
Peter Zijlstra
maintainerRe: [PATCH] CFS: Fix missing digit off in wmult table
Quoted 7 lines · Roman Zippel
Hi,
Quoted 1 line · Peter Zijlstra
By breaking the UNIX model of nice levels. Not an option in my book.
Breaking user expectations of nice levels is?
http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap03.html
specifically:
"3.239 Nice Value
A number used as advice to the system to alter process scheduling. Numerically smaller values give a process additional preference when scheduling a process to run. Numerically larger values reduce the preference and make a process less likely to run. Typically, a process with a smaller nice value runs to completion more quickly than an equivalent process with a higher nice value. The symbol {NZERO} specifies the default nice value of the system."
The only expectation is that a process with a lower nice level gets more time. Any other expectation is a bug.
Re: [PATCH] CFS: Fix missing digit off in wmult table
Hi,
Quoted 2 lines · Peter Zijlstra
The only expectation is that a process with a lower nice level gets more time. Any other expectation is a bug.
Yes, users are buggy, they expect a lot of stupid things... Is this really reason enough to break this?
What exactly is the damage if setpriority() accepts a few more levels?
bye, Roman
Re: [PATCH] CFS: Fix missing digit off in wmult table
In reply to Roman ZippelQuoted 3 lines · Roman Zippel
Quoted 1 line
By breaking the UNIX model of nice levels. Not an option in my book.
Breaking user expectations of nice levels is?
_changing_ it is an option within reason, and we've done it a couple of times already in the past, and even within CFS (as Peter correctly observed) we've been through a couple of iterations already. And as i mentioned it before, the outer edge of nice levels (+19, by far the most commonly used nice level) was inconsistent to begin with: 3%, 5%, 9% of nice-0, depending on HZ. So changing that to a consistent (and user-requested) 1.5% is a much smaller change than you seem to make it out to be. CFS itself is a far larger "change of expectations" than this tweak to nice levels. So by your standard we could never change the scheduler. (which your ultimate argument might be after all =B-)
Ingo
Re: [PATCH] CFS: Fix missing digit off in wmult table
Hi,
Quoted 6 lines · Ingo Molnar
_changing_ it is an option within reason, and we've done it a couple of times already in the past, and even within CFS (as Peter correctly observed) we've been through a couple of iterations already. And as i mentioned it before, the outer edge of nice levels (+19, by far the most commonly used nice level) was inconsistent to begin with: 3%, 5%, 9% of nice-0, depending on HZ.
Why do you constantly stress level 19? Yes, that one is special, all other positive levels were already relatively consistent.
Quoted 2 lines
So changing that to a consistent (and
user-requested)
How old is CFS and how many users did it have so far? How many users has the old scheduler, which will be exposed to the new one soon?
Quoted 2 lines
1.5% is a much smaller change than you seem to make it out to be.
The percentage levels are off by a factor of upto _seven_, sorry I fail see how you can characterize this as "small".
Quoted 2 lines
So by your standard we could never change the scheduler. (which your ultimate argument might be after all =B-)
Careful, you make assertion about me, for which you have absolutely no base, adding a smiley doesn't make this any funnier.
bye, Roman
Re: [PATCH] CFS: Fix missing digit off in wmult table
Quoted 9 lines · Roman Zippel
Quoted 6 lines
_changing_ it is an option within reason, and we've done it a couple of times already in the past, and even within CFS (as Peter correctly observed) we've been through a couple of iterations already. And as i mentioned it before, the outer edge of nice levels (+19, by far the most commonly used nice level) was inconsistent to begin with: 3%, 5%, 9% of nice-0, depending on HZ.
Why do you constantly stress level 19? Yes, that one is special, all other positive levels were already relatively consistent.
i constantly stress it for the reason i mentioned a good number of
times: because it's by far the most commonly used (and complained about) nice level. =B-)
but because you are asking, i'm glad to give you some first-hand historic background about Linux nice levels (in case you are interested) and the motivations behind their old and new implementations:
nice levels were always so weak under Linux (just read Peter's report) that people continuously bugged me about making nice +19 tasks use up much less CPU time. Unfortunately that was not that easy to implement (otherwise we'd have done it long ago) because nice level support was historically coupled to timeslice length, and timeslice units were driven by the HZ tick, so the smallest timeslice was 1/HZ.
In the O(1) scheduler (about 4 years ago) i changed negative nice levels to be much stronger than they were before in 2.4 (and people were happy about that change), and i also intentionally calibrated the linear timeslice rule so that nice +19 level would be _exactly_ 1 jiffy. To better understand it, the timeslice graph went like this (cheesy ASCII art alert!):
A
\ | [timeslice length]
\ |
\ |
\ |
\ |
\|___100msecs
|^ . _
| ^ . _
| ^ . _
-*----------------------------------*-----> [nice level]
-20 | +19
|
|so that if someone wants to really renice tasks, +19 would give a much bigger hit than the normal linear rule would do. (The solution of changing the ABI to extend priorities was discarded early on.)
This approach worked to some degree for some time, but later on with HZ=1000 it caused 1 jiffy to be 1 msec, which meant 0.1% CPU usage which we felt to be a bit excessive. Excessive _not_ because it's too small of a CPU utilization, but because it causes too frequent (once per millisec) rescheduling. (and would thus trash the cache, etc. Remember, this was 4-5 years ago when hardware was weaker and caches were smaller, and people were running number crunching apps at nice +19.)
So for HZ=1000 i changed nice +19 to 5msecs, because that felt like the right minimal granularity - and this translates to 5% CPU utilization. But the fundamental HZ-sensitive property for nice+19 still remained, and i never got a single complaint about nice +19 being too _weak_ in terms of CPU utilization, i only got complaints about it (still) being way too _strong_.
To sum it up: i always wanted to make nice levels more consistent, but within the constraints of HZ and jiffies and their nasty design level coupling to timeslices and granularity it was not really viable.
The second (less frequent but still periodically occuring) complaint about Linux's nice level support was its assymetry around the origo (which you can see demonstrated in the picture above), or more
accurately: the fact that nice level behavior depended on the _absolute_ nice level as well, while the nice API itself is fundamentally "relative":
int nice(int inc);
asmlinkage long sys_nice(int increment)
(the first one is the glibc API, the second one is the syscall API.) Note that the 'inc' is relative to the current nice level. Tools like bash's "nice" command mirror this relative API.
With the old scheduler, if you for example started a niced task with +1 and another task with +2, the CPU split between the two tasks would depend on the nice level of the parent shell - if it was at nice -10 the CPU split was different than if it was at +5 or +10.
A third complaint against Linux's nice level support was that negative nice levels were not 'punchy enough', so lots of people had to resort to run audio (and other multimedia) apps under RT priorities such as SCHED_FIFO. But this caused other problems: SCHED_FIFO is not starvation proof, and a buggy SCHED_FIFO app can also lock up the system for good.
CFS addresses all three types of complaints:
To address the first complaint (of nice levels being not "punchy" enough), i decoupled the scheduler from 'time slice' and HZ concepts (and made granularity a separate concept from nice levels) and thus CFS was able to implement better and more consistent nice +19 support: now in CFS nice +19 tasks get a HZ-independent 1.5%, instead of the variable 3%-5%-9% range they got in the old scheduler.
To address the second complaint (of nice levels not being consistent), i made nice(1) have the same CPU utilization effect on tasks, regardless of their absolute nice levels. So on CFS, running a nice +10 and a nice +11 task has the same CPU utilization "split" between them as running a nice -5 and a nice -4 task. (one will get 55% of the CPU, the other 45%.) That is why I changed nice levels to be "multiplicative" (or exponential) - that way it does not matter which nice level you start out from, the 'relative result' will always be the same.
The third complaint (of negative nice levels not being "punchy" enough and forcing audio apps to run under the more dangerous SCHED_FIFO scheduling policy) is addressed by CFS almost automatically: stronger negative nice levels are an automatic side-effect of the recalibrated dynamic range of nice levels.
Hope this helps,
Ingo
Re: [PATCH] CFS: Fix missing digit off in wmult table
Hi,
Quoted 6 lines · Ingo Molnar
Quoted 2 lines
Why do you constantly stress level 19? Yes, that one is special, all other positive levels were already relatively consistent.
i constantly stress it for the reason i mentioned a good number of
times: because it's by far the most commonly used (and complained about) nice level. =B-)
How do you know that? Most complained about makes most commonly used?
Quoted 3 lines
but because you are asking, i'm glad to give you some first-hand historic background about Linux nice levels (in case you are interested) and the motivations behind their old and new implementations:
I guess I should be thankful now?
I'm curious why you post this now, after I "asked" about this. Most of the information is either rather generic or not specific enough for the problem at hand. If you had posted this information earlier, it had been far more valueable as it could have been a nice base for a discussion. But posting it this late I can't lose the feeling you're more interested in "teaching" me.
Quoted 1 line
nice levels were always so weak under Linux (just read Peter's report)
-ENOLINK
Quoted 1 line
Hope this helps,
Not completely.
For negative nice levels you mentioned audio apps, but these aren't really interested in a fair share, they would use the higher percentage only to guarantee they get the amount of time they need independent of the current load. I think they would be better served with e.g. a deadline scheduler, which guarantees them an absolute time share not a relative one.
On the other end with positive levels I more remember requests for something closer to idle scheduling, where a process only runs when nothing else is running.
So assuming we had scheduling classes for the above use cases, what other reasons are left for such extreme nice levels?
My proposed nice levels have otherwise the same properties as yours (e.g. being consistent). There is one propery you haven't commented on at all yet. My proposed levels give the average use a far better idea what they actually mean, i.e. that every 5 levels the process gets double/halve the cpu time. This is IMO a considerable advantage.
bye, Roman
Re: [PATCH] CFS: Fix missing digit off in wmult table
In reply to Peter ZijlstraHi,
Quoted 1 line · Peter Zijlstra
By breaking the UNIX model of nice levels. Not an option in my book.
BTW what is the "UNIX model of nice levels"?
SUS specifies the limit via NZERO, which is defined as "Minimum Acceptable
Value: 20", I can't find any information that it must be 20.
bye, Roman
Peter Zijlstra
maintainerRe: [PATCH] CFS: Fix missing digit off in wmult table
Quoted 10 lines · Roman Zippel
Hi,
Quoted 1 line · Peter Zijlstra
By breaking the UNIX model of nice levels. Not an option in my book.
BTW what is the "UNIX model of nice levels"?
SUS specifies the limit via NZERO, which is defined as "Minimum Acceptable
Value: 20", I can't find any information that it must be 20.
I have never encountered a UNIX where it is anything other than 20. Convention (alas not specification) does dictate 20.
Re: x86 status was Re: -mm merge plans for 2.6.23
In reply to Roman ZippelQuoted 7 lines · Roman Zippel
Hi,
Quoted 3 lines · Mike Galbraith
Quoted 2 lines
The new scheduler does _a_lot_ of heavy 64 bit calculations without any attempt to scale that down a little...
Quoted 6 lines
Quoted 2 lines
See prio_to_weight[], prio_to_wmult[] and
sysctl_sched_stat_granularity. Perhaps more can be done, but "without any attempt..." isn't accurate.Calculating these values at runtime would have been completely insane, the alternative would be a crummy approximation, so using a lookup table is actually a good thing. That's not the problem.
I meant see usage.
-Mike
CFS review
Hi,
Quoted 5 lines · Mike Galbraith
Quoted 5 lines · Mike Galbraith
Quoted 4 lines
Quoted 3 lines
The new scheduler does _a_lot_ of heavy 64 bit calculations without any attempt to scale that down a little...
Quoted 8 lines
Quoted 6 lines
Quoted 2 lines
See prio_to_weight[], prio_to_wmult[] and
sysctl_sched_stat_granularity. Perhaps more can be done, but "without any attempt..." isn't accurate.Calculating these values at runtime would have been completely insane, the alternative would be a crummy approximation, so using a lookup table is actually a good thing. That's not the problem.
I meant see usage.
I more meant serious attempts. At this point I'm not that much interested in a few localized optimizations, what I'm interested in is how can this optimized at the design level (e.g. how can arch information be used to simplify things). So I spent quite a bit of time looking through cfs and experimenting with some ideas. I want to put the main focus on the performance aspect, but there are a few other issues as well.
But first something else (especially for Ingo): I tried to be very careful with any claims made in this mail, but this of course doesn't exclude the possibility of errors, in which case I'd appreciate any corrections. Any explanations done in this mail don't imply that anyone needs any such explanations, they're done to keep things in context, so that interested readers have a chance to follow even if they don't have the complete background information. Any suggestions made don't imply that they have to be implemented like this, there are more an incentive for further discussion and I'm always interested in better solutions.
A first indication that something may not be quite right is the increase in code size:
2.6.22:
text data bss dec hex filename
10150 24 3344 13518 34ce kernel/sched.o
recent git:
text data bss dec hex filename
14724 228 2020 16972 424c kernel/sched.o
That's i386 without stats/debug. A lot of the new code is in regularly executed regions and it's often not exactly trivial code as cfs added lots of heavy 64bit calculations. With the increased text comes increased runtime memory usage, e.g. task_struct increased so that only 5 of them instead 6 fit now into 8KB.
Since sched-design-CFS.txt doesn't really go into any serious detail, so the EEVDF paper was more helpful and after playing with the ideas a little I noticed that the whole idea of fair scheduling can be explained somewhat simpler and I'm a little surprised not finding it mentioned anywhere.
So a different view on this is that the runtime of a task is simply normalized and the virtual time (or fair_clock) is the weighted average of these normalized runtimes. The advantage of normalization is that it makes things comparable, once the normalized time values are equal each task got its fair share. It's more obvious in the EEVDF paper, cfs makes it a bit more complicated, as it uses the virtual time to calculate the eligible runtime, but it doesn't maintain a per process virtual time (fair_key is not quite the same).
Here we get to the first problem, cfs is not overly accurate at maintaining a precise balance. First there a lot of rounding errors due to constant conversion between normalized and non-normalized values and the higher the update frequency the bigger the error. The effect of this can be seen by running:
while (1) sched_yield();
and watching the sched_debug output and watch the underrun counter go crazy. cfs thus needs the limiting to keep this misbehaviour under control. The problem here is that it's not that difficult to hit one of the many limits, which may change the behaviour and makes cfs hard to predict how it will behave under different situations.
The next issue is scheduler granularity, here I don't quite understand why the actual running time has no influence at all, which makes it difficult to predict how much cpu time a process will get at a time (even the comments only refer to the vmstat output). What is basically used instead is the normalized time since it was enqueued and practically it's a bit more complicated, as fair_key is not entirely a normalized time value. If the wait_runtime value is positive, higher prioritized tasks are given even more priority than they already get from their larger wait_runtime value. The problem here is that this triggers underruns and lower priority tasks get even less time.
Another issue is the sleep bonus given to sleeping tasks. A problem here is that this can be exploited, if a job is spread over a few threads, they can get more time relativ to other tasks, e.g. in this example there are three tasks that run only for about 1ms every 3ms, but they get far more time than should have gotten fairly:
4544 roman 20 0 1796 520 432 S 32.1 0.4 0:21.08 lt 4545 roman 20 0 1796 344 256 R 32.1 0.3 0:21.07 lt 4546 roman 20 0 1796 344 256 R 31.7 0.3 0:21.07 lt 4547 roman 20 0 1532 272 216 R 3.3 0.2 0:01.94 l
The debug output for this is also interesting:
task PID tree-key delta waiting switches prio sum-exec sum-wait sum-sleep wait-overrun wait-underrun
------------------------------------------------------------------------------------------------------------------------------------------------------------------
lt 4544 42958653977764 -2800118 2797765 11753 120 11449444657 201615584 23750292211 9600 0
lt 4545 42958653767067 -3010815 2759284 11747 120 11442604925 202910051 23746575676 9613 0
l 4547 42958653330276 -3447606 1332892 32333 120 1035284848 -47628857 0 0 14247Practically this means a few interactive tasks can steal quite a lot of time from other tasks, which might try to get some work done. This may be fine in Desktop environments, but I'm not sure it can be that easily generalized. This can make cfs quite unfair, if waiting outside the runqueue has more advantages than waiting in the runqueue.
Finally there is still the issue with the nice levels, where I still think the massive increase overcompensates for adequate scheduling classes, e.g. to give audio apps a fixed amount of time instead of a relative portion.
Overall while cfs has a number of good ideas, I don't think it was quite ready for a stable release. Maybe it's possible to fix this until the release, but I certainly would have prefered less time pressure. It's not just the small inaccuracies, it's also the significantly increased complexity. In this regard I find the claim that cfs "has no heuristics whatsoever" interesting, for that to be true I would expect a little more accuracy, but that wouldn't be a big problem, if cfs were a really fast and compact scheduler and here it's quite hard to argue that cfs has been improvement in this particular area. Anyway, before Ingo starts accussing me now of "negativism", let's look at some possibilities how this could be improved.
To reduce the inaccuracies it's better to avoid conversion between normalized and real time values, so the first example program pretty much shows just that and demonstrate the very core of a scheduler. It maintains per task normalized times and uses only that to make the scheduling decision (it doesn't even need an explicit wait_runtime value). The nice thing about this how consistently it gives out time shares - unless there is a higher priority task, that task will get the maximum share, which makes the scheduling behaviour quite a bit more predictable.
The second example program is more complete (e.g. it demonstrates adding/removing tasks) but it's based on the same basic idea. First the floating point values are converted to fixed point values. To maintain accuracy one has to take overflows into account, cfs currently avoids overflows by throwing away (possibly important) information, but that adds checks all over the place instead of dealing with them within the design, so I consider this overflow avoidance a failed strategy - it doesn't make anything simpler and creates problems elsewhere. Of course the example program has its own limits, but in this case I can define them, so that within them the scheduler will work correctly. The most important limits are:
max normalized task time delta = max inverse weight * max cpu share
max normalized average time delta = max active tasks * max inverse weight * cpu share base
The first limit is used for comparing individual task and the second one is used for maintaining the average. With these limits it's possible to choose the appropriate data types that can hold these maximum values and then I don't really have to worry about overflows and I know the scheduler is accurate without the need for a lot of extra checks.
The second example also adds a normalized average, but contrary to current cfs it's not central to the design. An average is not needed to give every task its fair share, but it can be used to make better scheduling decisions to control _when_ a task gets its share. In this example I provided two possibilities where it's used to schedule new tasks, the first divides time into slices and sets a new task to the start of that slice, the second gives the task a full time share relative to the current average, but approximating the average (by looking just at the min/max time) should work as well.
The average here is not a weighted average, a weighted average is a little more complex to maintain accurately and has issues regarding overflows, so I'm using a simple average, which is sufficient especially since it's not a primary part of the scheduler anymore.
BTW above unfairness of sleeping tasks can be easily avoided in this model by simply making sure that normalized time never goes backward.
The accuracy of this model makes it possible to further optimize the code (it's really a key element, that's why I'm stressing it so much, OTOH it's rather difficult to further optimize current cfs without risking to make it worse).
For example the regular updates aren't really necessary, they can also be done when necessary (i.e. when scheduling, where an update is necessary anyway for precise accounting), the next schedule time can be easily precalculated instead. OTOH the regular updates allow for very cheap incremental updates, especially if one already knows that scheduler clock has only limited resolution (because it's based on jiffies), it becomes possible to use mostly 32bit values.
I hope the code example helps to further improve scheduler, I'm quite aware that it doesn't implement everything, but this just means some of the cfs design decisions need more explanation. I'm not really that much interested in scheduler, I only want a small and fast scheduler and that's some areas where cfs is no real improvement right now. cfs practically obliterated my efforts I put into the ntp code to keep the regular updates both cheap and highly precise...
bye, Roman
#include <stdio.h>
int weight[10] = {
20, 20, 20, 50, 20, 20, 20
};double time[10];
double ntime[10];
#define MIN_S 1
#define MAX_S 10
#define SLICE(x) (MAX_S / (double)weight[x])
#define MINSLICE(x) (MIN_S / (double)weight[x])
int main(void)
{
int i, j, l, w;
double s, t, min, max;
for (i = 0; i < 10; i++)
ntime[i] = time[i] = 0;
j = 0;
l = 0;
s = 0;
while (1) {
j = l ? 0 : 1;
for (i = 0; i < 10; i++) {
if (!weight[i] || i == l)
continue;
if (ntime[i] + MINSLICE(i) < ntime[j] + MINSLICE(j))
j = i;
}
if (ntime[l] >= ntime[j] + SLICE(j) ||
(ntime[l] >= ntime[j] &&
ntime[l] >= s + SLICE(l))) {
l = j;
s = ntime[l];
}
time[l] += MIN_S;
ntime[l] += MIN_S / (double)weight[l];
printf("%u", l);
for (i = 0, w = 0, t = 0; i < 10; i++) {
if (!weight[i])
continue;
w += weight[i];
t += ntime[i] * weight[i];
printf("\t%3u/%u:%5g/%-7g", i, weight[i], time[i], ntime[i]);
}
t /= w;
min = max = t;
for (i = 0; i < 10; i++) {
if (!weight[i])
continue;
if (ntime[i] < min)
min = ntime[i];
if (ntime[i] > max)
max = ntime[i];
}
printf("\t| %g (%g)\n", t, max - min);
}
}#include <stdio.h>
#include <stdlib.h>
struct task {
unsigned int weight, weight_inv;
int active;
unsigned int time, time_avg;
int time_norm, avg_fract;
} task[10] = {
{ .weight = 10 },
{ .weight = 40 },
{ .weight = 80 },
};#define MIN_S 100
#define MAX_S 1000
#define SLICE(x) (MAX_S * task[x].weight_inv)
#define MINSLICE(x) (MIN_S * task[x].weight_inv)
#define WEIGTH0 40
#define WEIGTH0_INV ((1 << 16) / WEIGTH0)
unsigned int time_avg, time_norm_sum;
int avg_fract, weight_sum_inv;
static void normalize_avg(int i)
{
if (!weight_sum_inv)
return;
/* assume the common case of 0/1 first, then fallback */
if (task[i].avg_fract < 0 || task[i].avg_fract >= WEIGTH0_INV * MAX_S) {
task[i].time_avg++;
task[i].avg_fract -= WEIGTH0_INV * MAX_S;
if (task[i].avg_fract < 0 || task[i].avg_fract >= WEIGTH0_INV * MAX_S) {
task[i].time_avg += task[i].avg_fract / (WEIGTH0_INV * MAX_S);
task[i].avg_fract %= WEIGTH0_INV * MAX_S;
}
}
if (avg_fract < 0 || avg_fract >= weight_sum_inv) {
time_avg++;
avg_fract -= weight_sum_inv;
if (avg_fract < 0 || avg_fract >= weight_sum_inv) {
time_avg += avg_fract / weight_sum_inv;
avg_fract %= weight_sum_inv;
}
}
}int main(void)
{
int i, j, l, task_cnt;
unsigned int s;
unsigned int time_sum, time_sum2;
task_cnt = time_avg = 0;
for (i = 0; i < 10; i++) {
if (!task[i].weight)
continue;
task[i].active = 1;
task_cnt++;
task[i].weight_inv = (1 << 16) / task[i].weight;
}
weight_sum_inv = task_cnt * WEIGTH0_INV * MAX_S;
printf("w: %u,%u\n", WEIGTH0_INV * MAX_S, weight_sum_inv);
time_norm_sum = avg_fract = 0;
l = 0;
s = 0;
while (1) {
j = -1;
for (i = 0; i < 10; i++) {
if (i == l)
continue;
if (!task[i].active && task[i].weight) {
if (!(rand() % 30)) {
normalize_avg(i);
task[i].active = 1;
if (!task_cnt)
goto done;
#if 1
if ((int)(task[i].time_avg - time_avg) < 0) {
task[i].time_norm -= (int)(task[i].time_avg - time_avg) * WEIGTH0_INV * MAX_S + task[i].avg_fract;
task[i].time_avg = time_avg;
task[i].avg_fract = 0;
}
#else
unsigned int new_time_avg = time_avg;
int new_avg_fract = avg_fract / task_cnt - task[i].weight_inv * MAX_S;
while (new_avg_fract < 0) {
new_time_avg--;
new_avg_fract += WEIGTH0_INV * MAX_S;
}
if ((int)(task[i].time_avg - new_time_avg) < 0 ||
((int)(task[i].time_avg - new_time_avg) == 0 &&
task[i].avg_fract < new_avg_fract)) {
task[i].time_norm += (int)(new_time_avg - task[i].time_avg) * WEIGTH0_INV * MAX_S +
new_avg_fract - task[i].avg_fract;
task[i].time_avg = new_time_avg;
task[i].avg_fract = new_avg_fract;
}
#endif
done:
task_cnt++;
weight_sum_inv += WEIGTH0_INV * MAX_S;
avg_fract += (int)(task[i].time_avg - time_avg) * WEIGTH0_INV * MAX_S + task[i].avg_fract;
time_norm_sum += task[i].time_norm;
}
}
if (!task[i].active)
continue;
if (j < 0 ||
(int)(task[i].time_norm + MINSLICE(i) - (task[j].time_norm + MINSLICE(j))) < 0)
j = i;
}
if (!task[l].active) {
if (j < 0)
continue;
goto do_switch;
}
if (!(rand() % 100)) {
task[l].active = 0;
task_cnt--;
weight_sum_inv -= WEIGTH0_INV * MAX_S;
avg_fract -= (int)(task[l].time_avg - time_avg) * WEIGTH0_INV * MAX_S + task[l].avg_fract;
time_norm_sum -= task[l].time_norm;
if (j < 0)
continue;
goto do_switch;
}
if (j >= 0 &&
((int)(task[l].time_norm - (task[j].time_norm + SLICE(j))) >= 0 ||
((int)(task[l].time_norm - task[j].time_norm) >= 0 &&
(int)(task[l].time_norm - (s + SLICE(l))) >= 0))) {
int prev_time_avg;
do_switch:
prev_time_avg = time_avg;
normalize_avg(l);
if (prev_time_avg < time_avg)
printf("-\n");
l = j;
s = task[l].time_norm;
}
task[l].time += MIN_S;
task[l].time_norm += MINSLICE(l);
task[l].avg_fract += MINSLICE(l);
time_norm_sum += MINSLICE(l);
avg_fract += MINSLICE(l);
printf("%u", l);
time_sum = time_sum2 = 0;
for (i = 0; i < 10; i++) {
if (!task[i].active) {
if (task[i].weight)
printf("\t%3u/%u: -\t", i, task[i].weight);
continue;
}
time_sum += task[i].time_norm;
time_sum2 += task[i].time_avg * WEIGTH0_INV * MAX_S + task[i].avg_fract;
printf("\t%3u/%u:%5u/%-7g/%-7g", i, task[i].weight, task[i].time,
(double)task[i].time_norm / (1 << 16),
task[i].time_avg + (double)task[i].avg_fract / (WEIGTH0_INV * MAX_S));
}
if (time_sum != time_norm_sum)
abort();
if (time_sum2 != time_avg * weight_sum_inv + avg_fract)
abort();
if (time_sum != time_sum2)
abort();
printf("\t| %g/%g\n", (double)time_norm_sum / task_cnt / (1 << 16),
time_avg + (double)(int)avg_fract / weight_sum_inv);
}
}Re: CFS review
Roman,
Thanks for the testing and the feedback, it's much appreciated! :-) On what platform did you do your tests, and what .config did you use (and could you please send me your .config)?
Please also send me the output of this script:
http://people.redhat.com/mingo/cfs-scheduler/tools/cfs-debug-info.sh
(if the output is too large send it to me privately, or bzip2 -9 it.)
Could you also please send the source code for the "l.c" and "lt.c" apps you used for your testing so i can have a look. Thanks!
Ingo
Re: CFS review
Quoted 6 lines · Ingo Molnar
Roman,
Thanks for the testing and the feedback, it's much appreciated! :-) On what platform did you do your tests, and what .config did you use (and could you please send me your .config)?
Quoted 8 lines
Please also send me the output of this script:
http://people.redhat.com/mingo/cfs-scheduler/tools/cfs-debug-info.sh
(if the output is too large send it to me privately, or bzip2 -9 it.)
Could you also please send the source code for the "
l.c" and "lt.c" apps you used for your testing so i can have a look. Thanks!
I haven't been able to reproduce this with any combination of features, and massive_intr tweaked to his work/sleep cycle. I notice he's collecting stats though, and they look funky. Recompiling.
-Mike
Re: CFS review
Quoted 11 lines · Mike Galbraith
Quoted 11 lines
Thanks for the testing and the feedback, it's much appreciated! :-) On what platform did you do your tests, and what .config did you use (and could you please send me your .config)?
Please also send me the output of this script:
http://people.redhat.com/mingo/cfs-scheduler/tools/cfs-debug-info.sh
(if the output is too large send it to me privately, or bzip2 -9 it.)
Quoted 6 lines
Quoted 2 lines
Could you also please send the source code for the "
l.c" and "lt.c" apps you used for your testing so i can have a look. Thanks!I haven't been able to reproduce this with any combination of features, and
massive_intrtweaked to his work/sleep cycle. I notice he's collecting stats though, and they look funky. Recompiling.
yeah, the posted numbers look most weird, but there's a complete lack of any identification of test environment - so we'll need some more word from Roman. Perhaps this was run on some really old box that does not have a high-accuracy sched_clock()? The patch below should simulate that scenario on 32-bit x86.
Ingo
arch/i386/kernel/tsc.c +1 -1
@@ -110,7 +110,7 @@ unsigned long long native_sched_clock(vo* very important for it to be as fast as the platform * can achive it. ) */ -if (unlikely (!tsc_enabled && !tsc_unstable)) +// if (unlikely(!tsc_enabled && !tsc_unstable)) /* No locking but a rare wrong value is not a big deal: */ return (jiffies_64 -INITIAL_JIFFIES ) * (1000000000 /HZ );
Re: CFS review
Quoted 19 lines · Ingo Molnar
Quoted 3 lines · Mike Galbraith
I haven't been able to reproduce this with any combination of features, and
massive_intrtweaked to his work/sleep cycle. I notice he's collecting stats though, and they look funky. Recompiling.yeah, the posted numbers look most weird, but there's a complete lack of any identification of test environment - so we'll need some more word
Quoted 1 line
from Roman. Perhaps this was run on some really old box that does not
have a high-accuracy
sched_clock()? The patch below should simulate that scenario on 32-bit x86.Ingo
Index:
linux/arch/i386/kernel/tsc.c
===================================================================
arch/i386/kernel/tsc.c unsigned long long native_sched_clock(vo · line 116
Quoted 8 lines
arch/i386/kernel/tsc.c +1
-1@@ -110,7 +110,7 @@ unsigned long long native_sched_clock(vo* very important for it to be as fast as the platform * can achive it. ) */ -if (unlikely (!tsc_enabled && !tsc_unstable)) +// if (unlikely(!tsc_enabled && !tsc_unstable)) /* No locking but a rare wrong value is not a big deal: */ return (jiffies_64 -INITIAL_JIFFIES ) * (1000000000 /HZ );
Ah, thanks. I noticed that clocksource= went away. I'll test with stats, with and without jiffies resolution.
-Mike
Re: CFS review
Quoted 10 lines · Mike Galbraith
Quoted 8 lines · Ingo Molnar
yeah, the posted numbers look most weird, but there's a complete lack of any identification of test environment - so we'll need some more word
Quoted 1 line
from Roman. Perhaps this was run on some really old box that does not
have a high-accuracy
sched_clock()? The patch below should simulate that scenario on 32-bit x86.Ingo
Quoted 16 lines
arch/i386/kernel/tsc.c unsigned long long native_sched_clock(vo · line 116
Quoted 13 lines
Index:
linux/arch/i386/kernel/tsc.c
===================================================================arch/i386/kernel/tsc.c +1
-1@@ -110,7 +110,7 @@ unsigned long long native_sched_clock(vo* very important for it to be as fast as the platform * can achive it. ) */ -if (unlikely (!tsc_enabled && !tsc_unstable)) +// if (unlikely(!tsc_enabled && !tsc_unstable)) /* No locking but a rare wrong value is not a big deal: */ return (jiffies_64 -INITIAL_JIFFIES ) * (1000000000 /HZ );Ah, thanks. I noticed that clocksource= went away. I'll test with stats, with and without jiffies resolution.
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ P COMMAND 6465 root 20 0 1432 356 296 R 30 0.0 1:02.55 1 chew 6462 root 20 0 1576 216 140 R 23 0.0 0:50.29 1 massive_intr_x 6463 root 20 0 1576 216 140 R 23 0.0 0:50.23 1 massive_intr_x 6464 root 20 0 1576 216 140 R 23 0.0 0:50.28 1 massive_intr_x
Well, jiffies resolution clock did upset fairness a bit with a right at jiffies resolution burn time, but not nearly as bad as on Roman's box, and not in favor of the sleepers. With the longer burn time of stock massive_intr.c (8ms burn, 1ms sleep), lower resolution clock didn't upset it.
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ P COMMAND 6511 root 20 0 1572 220 140 R 25 0.0 1:00.11 1 massive_intr 6512 root 20 0 1572 220 140 R 25 0.0 1:00.14 1 massive_intr 6514 root 20 0 1432 356 296 R 25 0.0 1:00.31 1 chew 6513 root 20 0 1572 220 140 R 24 0.0 1:00.14 1 massive_intr
-Mike
Re: CFS review
In reply to Ingo MolnarHi,
Quoted 3 lines · Ingo Molnar
Please also send me the output of this script:
http://people.redhat.com/mingo/cfs-scheduler/tools/cfs-debug-info.sh
Send privately.
Quoted 2 lines
Could you also please send the source code for the "
l.c" and "lt.c" apps you used for your testing so i can have a look. Thanks!
l.c is a simple busy loop (well, with the option to start many of them). This is lt.c, what it does is to run a bit less than a jiffie, so it needs a low resolution clock to trigger the problem:
#include <stdio.h>
#include <signal.h>
#include <time.h>
#include <sys/time.h>
#define NSEC 1000000000
#define USEC 1000000
#define PERIOD (NSEC/1000)
int i;
void worker(int sig)
{
struct timeval tv;
long long t0, t;
gettimeofday(&tv, 0);
//printf("%u,%lu\n", i, tv.tv_usec);
t0 = (long long)tv.tv_sec * 1000000 + tv.tv_usec + PERIOD / 1000 - 50;
do {
gettimeofday(&tv, 0);
t = (long long)tv.tv_sec * 1000000 + tv.tv_usec;
} while (t < t0);}
int main(int ac, char **av)
{
int cnt;
timer_t timer;
struct itimerspec its;
struct sigaction sa;
cnt = i = atoi(av[1]);
sa.sa_handler = worker;
sa.sa_flags = 0;
sigemptyset(&sa.sa_mask);
sigaction(SIGALRM, &sa, 0);
clock_gettime(CLOCK_MONOTONIC, &its.it_value);
its.it_interval.tv_sec = 0;
its.it_interval.tv_nsec = PERIOD * cnt;
while (--i > 0 && fork() > 0)
;
its.it_value.tv_nsec += i * PERIOD;
if (its.it_value.tv_nsec > NSEC) {
its.it_value.tv_sec++;
its.it_value.tv_nsec -= NSEC;
}
timer_create(CLOCK_MONOTONIC, 0, &timer);
timer_settime(timer, TIMER_ABSTIME, &its, 0);
printf("%u,%lu\n", i, its.it_interval.tv_nsec);
while (1)
pause();
return 0;
}Re: CFS review
Quoted 5 lines · Roman Zippel
Quoted 3 lines
Please also send me the output of this script:
http://people.redhat.com/mingo/cfs-scheduler/tools/cfs-debug-info.sh
Send privately.
thanks. Just to make sure, while you said that your TSC was off on that laptop, the bootup log of yours suggests a working TSC:
Time: tsc clocksource has been installed.
and still your fl.c testcases produces the top output that you've reported in your first mail? If so then this could be a regression. Or did you turn off the tsc manually via notsc? (or was it with a different .config or on a different machine)? Please help us figure this out exactly, we dont want a real regression go unnoticed.
If you can reproduce that problem with a working TSC then please generate a second cfs-debug-info.sh snapshot _while_ your fl+l workload is running and send that to me (i'll reply back to it publicly). Thanks,
Ingo
Re: CFS review
Quoted 4 lines · Ingo Molnar
thanks. Just to make sure, while you said that your TSC was off on that laptop, the bootup log of yours suggests a working TSC:
Time: tsc clocksource has been installed.
Standard kernels often disable the TSC later after running a bit with it (e.g. on any cpufreq change without p state invariant TSC)
-Andi
Re: CFS review
Quoted 9 lines · Andi Kleen
Quoted 4 lines · Ingo Molnar
thanks. Just to make sure, while you said that your TSC was off on that laptop, the bootup log of yours suggests a working TSC:
Time: tsc clocksource has been installed.
Standard kernels often disable the TSC later after running a bit with it (e.g. on any cpufreq change without p state invariant TSC)
I assume that what Roman hit was that he had explicitly disabled the TSC because of TSC instability with the "notsc" kernel command line. Which disabled is *entirely*.
That *used* to be the right thing to do, since the gettimeofday() logic originally didn't know about TSC instability, and it just resulted in somewhat flaky timekeeping.
These days, of course, we should notice it on our own, and just switch away from the TSC as a reliable clock-source, but still allow it to be used for the cases where absolute accuracy is not a big issue.
So I suspect that Roman - by virtue of being an old-timer - ends up having a workaround for an old problem that isn't needed, and that in turn ends up meaning that his scheduler clock also ends up using the really not very good timer tick..
Linus
Re: CFS review
Quoted 3 lines
I assume that what Roman hit was that he had explicitly disabled the TSC because of TSC instability with the "notsc" kernel command line. Which disabled is *entirely*.
It might just have been cpufreq. That nearly hits everybody with cpufreq unless you have a pstate invariant TSC; and that's pretty much always the case on older laptops.
It used to not be that drastic, but since i386 switched to the generic clock frame work it is like that :/
Quoted 3 lines
These days, of course, we should notice it on our own, and just switch away from the TSC as a reliable clock-source, but still allow it to be used for the cases where absolute accuracy is not a big issue.
The rewritten sched_clock() i still have queued does just that. I planned to submit it for .23, but then during later in deepth testing on my machine park I found a show stopper that I couldn't fix on time. Hopefully for .24
-Andi
Re: CFS review
In reply to Linus TorvaldsQuoted 7 lines · Linus Torvalds
Quoted 5 lines · Andi Kleen
Quoted 3 lines · Ingo Molnar
thanks. Just to make sure, while you said that your TSC was off on that laptop, the bootup log of yours suggests a working TSC:
Quoted 8 lines
Quoted 4 lines
Quoted 1 line
Time: tsc clocksource has been installed.
Standard kernels often disable the TSC later after running a bit with it (e.g. on any cpufreq change without p state invariant TSC)
I assume that what Roman hit was that he had explicitly disabled the TSC because of TSC instability with the "notsc" kernel command line. Which disabled is *entirely*.
but that does not appear to be the case, the debug info i got from Roman includes the following boot options:
Kernel command line: auto BOOT_IMAGE=2.6.23-rc1-git9 ro root=306
there's no "notsc" option there.
Andi's theory cannot be true either, Roman's debug info also shows this /proc/<PID>/sched data:
clock-delta : 95
that means that sched_clock() is in high-res mode, the TSC is alive and kicking and a sched_clock() call took 95 nanoseconds.
Roman, could you please help us with this mystery?
Ingo
Re: CFS review
Hi,
Quoted 9 lines · Ingo Molnar
Andi's theory cannot be true either, Roman's debug info also shows this /proc/<PID>/sched data:
clock-delta : 95
that means that
sched_clock()is in high-res mode, the TSC is alive and kicking and asched_clock()call took 95 nanoseconds.Roman, could you please help us with this mystery?
Actually, Andi is right. What I sent you was generated directly after boot, as I had to reboot for the right kernel, so a little later appeared this:
Aug 1 14:54:30 spit kernel: eth0: link up, 100Mbps, full-duplex, lpa 0x45E1 Aug 1 15:09:56 spit kernel: Clocksource tsc unstable (delta = 656747233 ns) Aug 1 15:09:56 spit kernel: Time: pit clocksource has been installed.
bye, Roman
Re: CFS review
Quoted 14 lines · Roman Zippel
Hi,
Quoted 9 lines · Ingo Molnar
Andi's theory cannot be true either, Roman's debug info also shows this /proc/<PID>/sched data:
clock-delta : 95
that means that
sched_clock()is in high-res mode, the TSC is alive and kicking and asched_clock()call took 95 nanoseconds.Roman, could you please help us with this mystery?
Quoted 7 lines
Actually, Andi is right. What I sent you was generated directly after boot, as I had to reboot for the right kernel, so a little later appeared this:
Aug 1 14:54:30 spit kernel: eth0: link up, 100Mbps, full-duplex, lpa 0x45E1 Aug 1 15:09:56 spit kernel: Clocksource tsc unstable (delta = 656747233 ns) Aug 1 15:09:56 spit kernel: Time: pit clocksource has been installed.
just to make sure, how does 'top' output of the l + "lt 3" testcase look like now on your laptop? Yesterday it was this:
4544 roman 20 0 1796 520 432 S 32.1 0.4 0:21.08 lt 4545 roman 20 0 1796 344 256 R 32.1 0.3 0:21.07 lt 4546 roman 20 0 1796 344 256 R 31.7 0.3 0:21.07 lt 4547 roman 20 0 1532 272 216 R 3.3 0.2 0:01.94 l
and i'm still wondering how that output was possible.
Ingo
Re: CFS review
Hi,
Quoted 9 lines · Ingo Molnar
just to make sure, how does 'top' output of the l + "lt 3" testcase look like now on your laptop? Yesterday it was this:
4544 roman 20 0 1796 520 432 S 32.1 0.4 0:21.08 lt 4545 roman 20 0 1796 344 256 R 32.1 0.3 0:21.07 lt 4546 roman 20 0 1796 344 256 R 31.7 0.3 0:21.07 lt 4547 roman 20 0 1532 272 216 R 3.3 0.2 0:01.94 land i'm still wondering how that output was possible.
I disabled the jiffies logic and the result is still the same, so this problem isn't related to resolution at all.
I traced it a little and what's happing is that the busy loop really only gets little time, it only runs inbetween the timer tasks. When the timer task is woken up __enqueue_sleeper() updates sleeper_bonus and a little later when the busy loop is preempted __update_curr() is called a last time and it's fully hit by the sleeper_bonus. So the timer tasks use less time than they actually get and thus produce overflows, the busy loop OTOH is punished and underflows.
So it seems my initial suspicion was right and this logic is dodgy, what is it actually supposed to do? Why is some random task accounted with the sleeper_bonus?
bye, Roman
PS: Can I still expect answer about all the other stuff?
Re: CFS review
Quoted 9 lines · Roman Zippel
Quoted 6 lines
4544 roman 20 0 1796 520 432 S 32.1 0.4 0:21.08 lt 4545 roman 20 0 1796 344 256 R 32.1 0.3 0:21.07 lt 4546 roman 20 0 1796 344 256 R 31.7 0.3 0:21.07 lt 4547 roman 20 0 1532 272 216 R 3.3 0.2 0:01.94 land i'm still wondering how that output was possible.
I disabled the jiffies logic and the result is still the same, so this problem isn't related to resolution at all.
how did you disable the jiffies logic? Also, could you please send me the cfs-debug-info.sh:
http://people.redhat.com/mingo/cfs-scheduler/tools/cfs-debug-info.sh
captured _while_ the above workload is running. This is the third time i've asked for that :-)
to establish that the basic sched_clock() behavior is sound on that box, could you please also run this tool:
http://people.redhat.com/mingo/cfs-scheduler/tools/tsc-dump.c
please run it both while the system is idle, and while there's a CPU hog running:
while :; do :; done &
and send me that output too? (it's 2x 60 lines only) Thanks!
Ingo
Re: CFS review
Hi,
Quoted 4 lines · Ingo Molnar
Quoted 2 lines
I disabled the jiffies logic and the result is still the same, so this problem isn't related to resolution at all.
how did you disable the jiffies logic?
I commented it out.
Quoted 7 lines
Also, could you please send me
thecfs-debug-info.sh:http://people.redhat.com/mingo/cfs-scheduler/tools/cfs-debug-info.sh
captured _while_ the above workload is running. This is the third time i've asked for that :-)
Is there any reason to believe my analysis is wrong?
So far you haven't answered a single question about the CFS design...
Anyway, I give you something better - the raw trace data for 2ms:
1186747669.274790012: update_curr 0xc7fb06f0,479587,319708,21288884188,159880,7360532 1186747669.274790375: dequeue_entity 0xc7fb06f0,21280402988,159880 1186747669.274792580: sched 2848,2846,0xc7432cb0,-7520413 1186747669.274820987: update_curr 0xc7432ce0,29302,-130577,21288913490,1,-7680293 1186747669.274821269: dequeue_entity 0xc7432ce0,21296077409,1 1186747669.274821930: enqueue_entity 0xc7432ce0,21296593783,1 1186747669.274826979: update_curr 0xc7432ce0,5707,5707,21288919197,1,-7680294 1186747669.274827724: enqueue_entity 0xc7432180,21280919197,639451 1186747669.274829948: update_curr 0xc7432ce0,1553,-318172,21288920750,319726,-8000000 1186747669.274831878: sched 2846,2847,0xc7432150,8000000 1186747669.275789883: update_curr 0xc7432180,479797,319935,21289400547,159864,7360339 1186747669.275790295: dequeue_entity 0xc7432180,21280919197,159864 1186747669.275792439: sched 2847,2846,0xc7432cb0,-7520203 1186747669.275820819: update_curr 0xc7432ce0,29238,-130625,21289429785,1,-7680067 1186747669.275821109: dequeue_entity 0xc7432ce0,21296593783,1 1186747669.275821763: enqueue_entity 0xc7432ce0,21297109852,1 1186747669.275826887: update_curr 0xc7432ce0,5772,5772,21289435557,1,-7680068 1186747669.275827652: enqueue_entity 0xc7fb0ca0,21281435557,639881 1186747669.275829826: update_curr 0xc7432ce0,1549,-318391,21289437106,319941,-8000000 1186747669.275831584: sched 2846,2849,0xc7fb0c70,8000000
About the values:
update_curr: sched_entity, delta_fair, delta_mine, fair_clock, sleeper_bonus, wait_runtime
(final values at the end of __update_curr)
{en,de}queue_entity: sched_entity, fair_key, sleeper_bonus
(at the start of __enqueue_entity/__dequeue_entity)
sched: prev_pid,pid,current,wait_runtime
(at the end of scheduling, note that current has a small structure offset to sched_entity)
It starts with a timer task going to sleep, the busy loop runs for a few usec until the timer tick, the next timer task is woken up (sleeper_bonus is increased). Before switching the tasks, current task is updated and it's punished with the sleeper_bonus.
These tests are done without the recent updates, but they don't seem to change the basic logic. AFAICT the change to __update_curr() only makes it more unpredictable, which task is punished with the sleeper_bonus.
So again, what is this logic _supposed_ to do?
bye, Roman
Re: CFS review
Quoted 9 lines · Roman Zippel
Quoted 7 lines
Also, could you please send me
thecfs-debug-info.sh:http://people.redhat.com/mingo/cfs-scheduler/tools/cfs-debug-info.sh
captured _while_ the above workload is running. This is the third time i've asked for that :-)
Is there any reason to believe my analysis is wrong?
please first give me the debug data captured with the script above (while the workload is running) - so that i can see the full picture about what's happening. Thanks,
Ingo
Re: CFS review
In reply to Roman ZippelI guess I'm going to have to give up on trying to reproduce this... my 3GHz P4 is just not getting there from here. Last attempt, compiled UP, HZ=1000 dynticks, full preempt and highres timers fwiw.
6392 root 20 0 1696 332 248 R 25.5 0.0 3:00.14 0 lt 6393 root 20 0 1696 332 248 R 24.9 0.0 3:00.15 0 lt 6391 root 20 0 1696 488 404 R 24.7 0.0 3:00.20 0 lt 6394 root 20 0 2888 1232 1028 R 24.5 0.1 2:58.58 0 sh
-Mike
Re: CFS review
Hi,
Quoted 8 lines · Mike Galbraith
I guess I'm going to have to give up on trying to reproduce this... my 3GHz P4 is just not getting there from here. Last attempt, compiled UP, HZ=1000 dynticks, full preempt and highres timers fwiw.
6392 root 20 0 1696 332 248 R 25.5 0.0 3:00.14 0 lt 6393 root 20 0 1696 332 248 R 24.9 0.0 3:00.15 0 lt 6391 root 20 0 1696 488 404 R 24.7 0.0 3:00.20 0 lt 6394 root 20 0 2888 1232 1028 R 24.5 0.1 2:58.58 0 sh
Except for UP and HZ=1000, everything else is pretty much turned off. If you use a very recent kernel, the problem may not be visible like this anymore.
It may be a bit easier to reproduce, if you change the end time t0 in lt.c a little. Also try to start the busy loop first.
bye, Roman
Re: CFS review
In reply to Roman ZippelQuoted 1 line · Roman Zippel
Is there any reason to believe my analysis is wrong?
Not yet, but if you give Ingo what he wants (as opposed to what you're giving him) it'll be easier for him to answer what's going wrong, and perhaps "fix" the problem to boot.
(The scripts gives info about CPU characteristics, interrupts, modules, etc. -- you know, all those "unknown" variables.)
And perhaps a patch to show what parts you commented out, too, so one can tell if anything got broken (unintentionally).
Signature · 6 lines
Michael Chang Please avoid sending me Word or PowerPoint attachments. Send me ODT, RTF, or HTML instead. See http://www.gnu.org/philosophy/no-word-attachments.html Thank you.
Re: CFS review
Hi,
Quoted 9 lines · Michael Chang
Quoted 1 line · Roman Zippel
Is there any reason to believe my analysis is wrong?
Not yet, but if you give Ingo what he wants (as opposed to what you're giving him) it'll be easier for him to answer what's going wrong, and perhaps "fix" the problem to boot.
(The scripts gives info about CPU characteristics, interrupts, modules, etc. -- you know, all those "unknown" variables.)
He already has most of this information and the trace shows _exactly_ what's going on. All this information should be more than enough to allow an initial judgement whether my analysis is correct.
Also none of this information is needed to explain the CFS logic a little more, which I'm still waiting for...
bye, Roman
Re: CFS review
Quoted 9 lines · Roman Zippel
Quoted 6 lines
Not yet, but if you give Ingo what he wants (as opposed to what you're giving him) it'll be easier for him to answer what's going wrong, and perhaps "fix" the problem to boot.
(The scripts gives info about CPU characteristics, interrupts, modules, etc. -- you know, all those "unknown" variables.)
He already has most of this information and the trace shows _exactly_ what's going on. [...]
i'll need the other bits of information too to have a complete picture about what's going on while your test is running - to maximize the chances of me being able to fix it. I'm a bit perplexed (and a bit worried) about this - you've spent _far_ more effort to _not send_ that script output (captured while the workload is running) than it would have taken to do it :-/ If you'd like me to fix bugs then please just send it (in private mail if you want) - or give me an ssh login to that box - whichever variant you prefer. Thanks,
Ingo
Re: CFS review
In reply to Roman ZippelQuoted 11 lines · Roman Zippel
Hi,
Quoted 7 lines · Michael Chang
Quoted 1 line · Roman Zippel
Is there any reason to believe my analysis is wrong?
Not yet, but if you give Ingo what he wants (as opposed to what you're giving him) it'll be easier for him to answer what's going wrong, and perhaps "fix" the problem to boot.
Quoted 8 lines
Quoted 2 lines
(The scripts gives info about CPU characteristics, interrupts, modules, etc. -- you know, all those "unknown" variables.)
He already has most of this information and the trace shows _exactly_ what's going on. All this information should be more than enough to allow an initial judgement whether my analysis is correct.
Also none of this information is needed to explain the CFS logic a little more, which I'm still waiting for...
Roman,
fortunately all bug reporters are not like you. It's amazing how long you can resist sending a simple bug report to a developer! Maybe you consider that you need to fix the bug by yourself after you understand the code, but if you systematically refuse to return the small information Ingo asks you, we will have to wait for some more cooperative users to be hit by the same bug when 2.6.23 is released, which is stupid.
I thought you could at least understand that one developer who is used to read traces from the same tool every day will be far faster at decoding a trace from the same tool than trying to figure out what your self-maid dump means.
It's the exact same reason I ask for pcap files when people send me outputs of tcpdumps without the information I *need*.
I you definitely do not want to cooperate, stop asking for a personal explanation, and go figure by yourself how the code works. BTW, in the trace you "kindly offered" in exchange for the cfs-debug-info dump, you show several useful variables, but nothing says where they are captured. And as you can see, they're changing. That's a fantastic trace for a developer, really...
Please try to be a little bit more transparent if you really want the bugs fixed, and don't behave as if you wanted this bug to survive till -final.
Thanks,
Willy
Re: CFS review
Hi,
Quoted 2 lines · Willy Tarreau
fortunately all bug reporters are not like you. It's amazing how long you can resist sending a simple bug report to a developer!
I'm more amazed how long Ingo can resist providing some explanations (not just about this problem).
It's not like I haven't given him anything, he already has the test programs, he already knows the system configuration.
Well, I've sent him the stuff now...
Quoted 3 lines
Maybe you
consider that you need to fix the bug by yourself after you understand the code,
Fixing the bug requires some knowledge what the code is intended to do.
Quoted 3 lines
Please try to be a little bit more transparent if you really want the bugs fixed, and don't behave as if you wanted this bug to survive till -final.
Could you please ask Ingo the same? I'm simply trying to get some transparancy into the CFS design. Without further information it's difficult to tell, whether something is supposed to work this way or it's a bug.
In this case it's quite possible that due to a recent change my testcase doesn't work anymore. Should I consider the problem fixed or did it just go into hiding? Without more information it's difficult to verify this independently.
bye, Roman
Re: CFS review
Quoted 1 line · Roman Zippel
Well, I've sent him the stuff now...
received it - thanks alot, looking at it!
Quoted 2 lines
It's not like I haven't given him anything, he already has the test programs, he already knows the system configuration.
one more small thing: could you please send your exact .config (Mike asked for that too, and i too on two prior occasions). Sometimes unexpected little details in the .config make a difference, we are not asking you that because we are second-guessing you in any way, the reason is simple: i frequently boot _the very .config that others use_, and see surprising reproducability of bugs that i couldnt trigger before. It's standard procedure to just pick up the .config of others to eliminate a whole bunch of degrees of freedom for a bug to hide behind - and your "it's a pretty standard config" description doesnt really achieve that. It probably wont make a real difference, but it's really easy for you to send and it's still very useful when one tries to eliminate possibilities and when one wants to concentrate on the remaining possibilities alone. Thanks again,
Ingo
Re: CFS review
Hi,
Quoted 4 lines · Ingo Molnar
achieve that. It probably wont make a real difference, but it's really easy for you to send and it's still very useful when one tries to eliminate possibilities and when one wants to concentrate on the remaining possibilities alone.
The thing I'm afraid about CFS is its possible unpredictability, which would make it hard to reproduce problems and we may end up with users with unexplainable weird problems. That's the main reason I'm trying so hard to push for a design discussion.
Just to give an idea here are two more examples of irregular behaviour, which are hopefully easier to reproduce.
1. Two simple busy loops, one of them is reniced to 15, according to my calculations the reniced task should get about 3.4% (1/(1.25^15+1)), but I get this:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 4433 roman 20 0 1532 300 244 R 99.2 0.2 5:05.51 l 4434 roman 35 15 1532 72 16 R 0.7 0.1 0:10.62 l
OTOH upto nice level 12 I get what I expect.
2. If I start 20 busy loops, initially I see in top that every task gets 5% and time increments equally (as it should):
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 4492 roman 20 0 1532 68 16 R 5.0 0.1 0:02.86 l 4491 roman 20 0 1532 68 16 R 5.0 0.1 0:02.86 l 4490 roman 20 0 1532 68 16 R 5.0 0.1 0:02.86 l 4489 roman 20 0 1532 68 16 R 5.0 0.1 0:02.86 l 4488 roman 20 0 1532 68 16 R 5.0 0.1 0:02.86 l 4487 roman 20 0 1532 68 16 R 5.0 0.1 0:02.86 l 4486 roman 20 0 1532 68 16 R 5.0 0.1 0:02.86 l 4485 roman 20 0 1532 68 16 R 5.0 0.1 0:02.86 l 4484 roman 20 0 1532 68 16 R 5.0 0.1 0:02.86 l 4483 roman 20 0 1532 68 16 R 5.0 0.1 0:02.86 l 4482 roman 20 0 1532 68 16 R 5.0 0.1 0:02.86 l 4481 roman 20 0 1532 68 16 R 5.0 0.1 0:02.86 l 4480 roman 20 0 1532 68 16 R 5.0 0.1 0:02.86 l 4479 roman 20 0 1532 68 16 R 5.0 0.1 0:02.86 l 4478 roman 20 0 1532 68 16 R 5.0 0.1 0:02.86 l 4477 roman 20 0 1532 68 16 R 5.0 0.1 0:02.86 l 4476 roman 20 0 1532 68 16 R 5.0 0.1 0:02.86 l 4475 roman 20 0 1532 68 16 R 5.0 0.1 0:02.86 l 4474 roman 20 0 1532 68 16 R 5.0 0.1 0:02.86 l 4473 roman 20 0 1532 296 244 R 5.0 0.2 0:02.86 l
But if I renice all of them to -15, the time every task gets is rather random:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 4492 roman 5 -15 1532 68 16 R 1.0 0.1 0:07.95 l 4491 roman 5 -15 1532 68 16 R 4.3 0.1 0:07.62 l 4490 roman 5 -15 1532 68 16 R 3.3 0.1 0:07.50 l 4489 roman 5 -15 1532 68 16 R 7.6 0.1 0:07.80 l 4488 roman 5 -15 1532 68 16 R 9.6 0.1 0:08.31 l 4487 roman 5 -15 1532 68 16 R 3.3 0.1 0:07.59 l 4486 roman 5 -15 1532 68 16 R 6.6 0.1 0:07.08 l 4485 roman 5 -15 1532 68 16 R 10.0 0.1 0:07.31 l 4484 roman 5 -15 1532 68 16 R 8.0 0.1 0:07.30 l 4483 roman 5 -15 1532 68 16 R 7.0 0.1 0:07.34 l 4482 roman 5 -15 1532 68 16 R 1.0 0.1 0:05.84 l 4481 roman 5 -15 1532 68 16 R 1.0 0.1 0:07.16 l 4480 roman 5 -15 1532 68 16 R 3.3 0.1 0:07.00 l 4479 roman 5 -15 1532 68 16 R 1.0 0.1 0:06.66 l 4478 roman 5 -15 1532 68 16 R 8.6 0.1 0:06.96 l 4477 roman 5 -15 1532 68 16 R 8.6 0.1 0:07.63 l 4476 roman 5 -15 1532 68 16 R 9.6 0.1 0:07.38 l 4475 roman 5 -15 1532 68 16 R 1.3 0.1 0:07.09 l 4474 roman 5 -15 1532 68 16 R 2.3 0.1 0:07.97 l 4473 roman 5 -15 1532 296 244 R 1.0 0.2 0:07.73 l
bye, Roman
Re: CFS review
Quoted 9 lines · Roman Zippel
Hi,
Quoted 4 lines · Ingo Molnar
achieve that. It probably wont make a real difference, but it's really easy for you to send and it's still very useful when one tries to eliminate possibilities and when one wants to concentrate on the remaining possibilities alone.
Quoted 4 lines
The thing I'm afraid about CFS is its possible unpredictability, which would make it hard to reproduce problems and we may end up with users with unexplainable weird problems. That's the main reason I'm trying so hard to push for a design discussion.
You may be interested by looking at the very early CFS versions. The design was much more naive and understandable. After that, a lot of tricks have been added to take into account a lot of uses and corner cases, which may not help in understanding it globally.
Quoted 10 lines
Just to give an idea here are two more examples of irregular behaviour, which are hopefully easier to reproduce.
1. Two simple busy loops, one of them is reniced to 15, according to my calculations the reniced task should get about 3.4% (1/(1.25^15+1)), but I get this:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 4433 roman 20 0 1532 300 244 R 99.2 0.2 5:05.51 l 4434 roman 35 15 1532 72 16 R 0.7 0.1 0:10.62 l
Could this be caused by typos in some tables like you have found in wmult ?
Quoted 4 lines
OTOH upto nice level 12 I get what I expect.
2. If I start 20 busy loops, initially I see in top that every task gets 5% and time increments equally (as it should):
(...)
Quoted 16 lines
But if I renice all of them to -15, the time every task gets is rather random:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 4492 roman 5 -15 1532 68 16 R 1.0 0.1 0:07.95 l 4491 roman 5 -15 1532 68 16 R 4.3 0.1 0:07.62 l 4490 roman 5 -15 1532 68 16 R 3.3 0.1 0:07.50 l 4489 roman 5 -15 1532 68 16 R 7.6 0.1 0:07.80 l 4488 roman 5 -15 1532 68 16 R 9.6 0.1 0:08.31 l 4487 roman 5 -15 1532 68 16 R 3.3 0.1 0:07.59 l 4486 roman 5 -15 1532 68 16 R 6.6 0.1 0:07.08 l 4485 roman 5 -15 1532 68 16 R 10.0 0.1 0:07.31 l 4484 roman 5 -15 1532 68 16 R 8.0 0.1 0:07.30 l 4483 roman 5 -15 1532 68 16 R 7.0 0.1 0:07.34 l 4482 roman 5 -15 1532 68 16 R 1.0 0.1 0:05.84 l 4481 roman 5 -15 1532 68 16 R 1.0 0.1 0:07.16 l
Quoted 8 lines
4480 roman 5 -15 1532 68 16 R 3.3 0.1 0:07.00 l 4479 roman 5 -15 1532 68 16 R 1.0 0.1 0:06.66 l 4478 roman 5 -15 1532 68 16 R 8.6 0.1 0:06.96 l 4477 roman 5 -15 1532 68 16 R 8.6 0.1 0:07.63 l 4476 roman 5 -15 1532 68 16 R 9.6 0.1 0:07.38 l 4475 roman 5 -15 1532 68 16 R 1.3 0.1 0:07.09 l 4474 roman 5 -15 1532 68 16 R 2.3 0.1 0:07.97 l 4473 roman 5 -15 1532 296 244 R 1.0 0.2 0:07.73 l
Do you see this only at -15, or starting with -15 and below ?
Willy
Re: CFS review
Quoted 10 lines · Willy Tarreau
Quoted 7 lines
1. Two simple busy loops, one of them is reniced to 15, according to my calculations the reniced task should get about 3.4% (1/(1.25^15+1)), but I get this:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 4433 roman 20 0 1532 300 244 R 99.2 0.2 5:05.51 l 4434 roman 35 15 1532 72 16 R 0.7 0.1 0:10.62 lCould this be caused by typos in some tables like you have found in wmult ?
note that the typo was not in the weight table but in the inverse weight table which didnt really affect CPU utilization (that's why we didnt notice the typo sooner). Regarding the above problem with nice +15 being beefier than intended i'd suggest to re-test with a doubled /proc/sys/kernel/sched_runtime_limit value, or with:
echo 30 > /proc/sys/kernel/sched_features
(which turns off sleeper fairness)
Quoted 7 lines
Quoted 5 lines
4477 roman 5 -15 1532 68 16 R 8.6 0.1 0:07.63 l 4476 roman 5 -15 1532 68 16 R 9.6 0.1 0:07.38 l 4475 roman 5 -15 1532 68 16 R 1.3 0.1 0:07.09 l 4474 roman 5 -15 1532 68 16 R 2.3 0.1 0:07.97 l 4473 roman 5 -15 1532 296 244 R 1.0 0.2 0:07.73 lDo you see this only at -15, or starting with -15 and below ?
i think this was scheduling jitter caused by the larger granularity of negatively reniced tasks. This got improved recently, with latest -git i get:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 3108 root 5 -15 1576 248 196 R 5.0 0.0 0:07.26 loop_silent 3109 root 5 -15 1576 248 196 R 5.0 0.0 0:07.26 loop_silent 3110 root 5 -15 1576 248 196 R 5.0 0.0 0:07.26 loop_silent 3111 root 5 -15 1576 244 196 R 5.0 0.0 0:07.26 loop_silent 3112 root 5 -15 1576 248 196 R 5.0 0.0 0:07.26 loop_silent 3113 root 5 -15 1576 248 196 R 5.0 0.0 0:07.26 loop_silent
that's picture-perfect CPU time distribution. But, and that's fair to say, i never ran such an artificial workload of 20x nice -15 infinite loops (!) before, and boy does interactivity suck (as expected) ;)
Ingo
Re: CFS review
In reply to Ingo MolnarQuoted 5 lines · Ingo Molnar
Quoted 1 line · Roman Zippel
Well, I've sent him the stuff now...
received it - thanks alot, looking at it!
everything looks good in your debug output and the TSC dump data, except for the wait_runtime values, they are quite out of balance - and that balance cannot be explained with jiffies granularity or with any sort of sched_clock() artifact. So this clearly looks like a CFS regression that should be fixed.
the only relevant thing that comes to mind at the moment is that last week Peter noticed a buggy aspect of sleeper bonuses (in that we do not rate-limit their output, hence we 'waste' them instead of redistributing them), and i've got the small patch below in my queue to fix that - could you give it a try?
this is just a blind stab into the dark - i couldnt see any real impact from that patch in various workloads (and it's not upstream yet), so it might not make a big difference. The trace you did (could you send the source for that?) seems to implicate sleeper bonuses though.
if this patch doesnt help, could you check the general theory whether it's related to sleeper-fairness, via turning it off:
echo 30 > /proc/sys/kernel/sched_features
does the bug go away if you do that? If sleeper bonuses are showing too many artifacts then we could turn it off for final .23.
Ingo
--------------------->
Subject: sched: fix sleeper bonus
From: Ingo Molnar <[email protected]>
Peter Ziljstra noticed that the sleeper bonus deduction code was not properly rate-limited: a task that scheduled more frequently would get a disproportionately large deduction. So limit the deduction to delta_exec and limit production to runtime_limit.
--- kernel/sched_fair.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
kernel/sched_fair.c +6 -6
@@ -75,7 +75,7 @@ enum {unsigned int sysctl_sched_features__read_mostly =SCHED_FEAT_FAIR_SLEEPERS *1 | -SCHED_FEAT_SLEEPER_AVG *1 | +SCHED_FEAT_SLEEPER_AVG *0 |SCHED_FEAT_SLEEPER_LOAD_AVG *1 |SCHED_FEAT_PRECISE_CPU_LOAD *1 | SCHED_FEAT_START_DEBIT *1 |
@@ -304,11 +304,9 @@ __update_curr(struct cfs_rq *cfs_rq, str delta_mine =calc_delta_mine (delta_exec, curr->load.weight, lw);if (cfs_rq->sleeper_bonus > sysctl_sched_granularity) { - delta =calc_delta_mine (cfs_rq->sleeper_bonus, - curr->load.weight, lw); -if (unlikely (delta > cfs_rq->sleeper_bonus)) - delta = cfs_rq->sleeper_bonus; - + delta =min (cfs_rq->sleeper_bonus, (u64 )delta_exec); + delta =calc_delta_mine (delta, curr->load.weight, lw); + delta =min ((u64 )delta, cfs_rq->sleeper_bonus); cfs_rq->sleeper_bonus -= delta; delta_mine -= delta; }
@@ -521,6 +519,8 @@ static void __enqueue_sleeper(struct cfs* Track the amount of bonus we've given to sleepers: */ cfs_rq->sleeper_bonus += delta_fair; +if (unlikely (cfs_rq->sleeper_bonus > sysctl_sched_runtime_limit)) + cfs_rq->sleeper_bonus = sysctl_sched_runtime_limit;schedstat_add (cfs_rq, wait_runtime, se->wait_runtime); }
Re: CFS review
Hi,
Quoted 5 lines · Ingo Molnar
the only relevant thing that comes to mind at the moment is that last week Peter noticed a buggy aspect of sleeper bonuses (in that we do not rate-limit their output, hence we 'waste' them instead of redistributing them), and i've got the small patch below in my queue to fix that - could you give it a try?
It doesn't make much of a difference. OTOH if I disabled the sleeper code completely in __update_curr(), I get this:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 3139 roman 20 0 1796 344 256 R 21.7 0.3 0:02.68 lt 3138 roman 20 0 1796 344 256 R 21.7 0.3 0:02.68 lt 3137 roman 20 0 1796 520 432 R 21.7 0.4 0:02.68 lt 3136 roman 20 0 1532 268 216 R 34.5 0.2 0:06.82 l
Disabling this code completely via sched_features makes only a minor difference:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 3139 roman 20 0 1796 344 256 R 20.4 0.3 0:09.94 lt 3138 roman 20 0 1796 344 256 R 20.4 0.3 0:09.94 lt 3137 roman 20 0 1796 520 432 R 20.4 0.4 0:09.94 lt 3136 roman 20 0 1532 268 216 R 39.1 0.2 0:19.20 l
Quoted 3 lines
this is just a blind stab into the dark - i couldnt see any real impact from that patch in various workloads (and it's not upstream yet), so it might not make a big difference.
Can we please skip to the point, where you try to explain the intention a little more?
If I had to guess that this is supposed to keep the runtime balance, then it would be better to use wait_runtime to adjust fair_clock, from where it would be evenly distributed to all tasks (but this had to be done during enqueue and dequeue). OTOH this also had then a consequence for the wait queue, as fair_clock is used to calculate fair_key.
IMHO current wait_runtime should have some influence in calculating the sleep bonus, so that wait_runtime doesn't constantly overflow for tasks which only run occasionally.
bye, Roman
Re: CFS review
Quoted 11 lines · Roman Zippel
Hi,
Quoted 5 lines · Ingo Molnar
the only relevant thing that comes to mind at the moment is that last week Peter noticed a buggy aspect of sleeper bonuses (in that we do not rate-limit their output, hence we 'waste' them instead of redistributing them), and i've got the small patch below in my queue to fix that - could you give it a try?
It doesn't make much of a difference.
I thought this was history. With your config, I was finally able to reproduce the anomaly (only with your proggy though), and Ingo's patch does indeed fix it here.
Freshly reproduced anomaly and patch verification, running 2.6.23-rc3 with your config, both with and without Ingo's patch reverted:
6561 root 20 0 1696 492 404 S 32.0 0.0 0:30.83 0 lt 6562 root 20 0 1696 336 248 R 32.0 0.0 0:30.79 0 lt 6563 root 20 0 1696 336 248 R 32.0 0.0 0:30.80 0 lt 6564 root 20 0 2888 1236 1028 R 4.6 0.1 0:05.26 0 sh
6507 root 20 0 2888 1236 1028 R 25.8 0.1 0:30.75 0 sh 6504 root 20 0 1696 492 404 R 24.4 0.0 0:29.26 0 lt 6505 root 20 0 1696 336 248 R 24.4 0.0 0:29.26 0 lt 6506 root 20 0 1696 336 248 R 24.4 0.0 0:29.25 0 lt
-Mike
Re: CFS review
Quoted 14 lines · Mike Galbraith
Quoted 1 line
It doesn't make much of a difference.
I thought this was history. With your config, I was finally able to reproduce the anomaly (only with your proggy though), and Ingo's patch does indeed fix it here.
Freshly reproduced anomaly and patch verification, running 2.6.23-rc3 with your config, both with and without Ingo's patch reverted:
6561 root 20 0 1696 492 404 S 32.0 0.0 0:30.83 0 lt 6562 root 20 0 1696 336 248 R 32.0 0.0 0:30.79 0 lt 6563 root 20 0 1696 336 248 R 32.0 0.0 0:30.80 0 lt 6564 root 20 0 2888 1236 1028 R 4.6 0.1 0:05.26 0 sh
Quoted 4 lines
6507 root 20 0 2888 1236 1028 R 25.8 0.1 0:30.75 0 sh 6504 root 20 0 1696 492 404 R 24.4 0.0 0:29.26 0 lt 6505 root 20 0 1696 336 248 R 24.4 0.0 0:29.26 0 lt 6506 root 20 0 1696 336 248 R 24.4 0.0 0:29.25 0 lt
oh, great! I'm glad we didnt discard this as a pure sched_clock resolution artifact.
Roman, a quick & easy request: please send the usual cfs-debug-info.sh output captured while your testcase is running. (Preferably try .23-rc3 or later as Mike did, which has the most recent scheduler code, it includes the patch i sent to you already.) I'll reply to your sleeper-fairness questions separately, but in any case we need to figure out what's happening on your box - if you can still reproduce it with .23-rc3. Thanks,
Ingo
Re: CFS review
In reply to Mike GalbraithHi,
Quoted 6 lines · Mike Galbraith
I thought this was history. With your config, I was finally able to reproduce the anomaly (only with your proggy though), and Ingo's patch does indeed fix it here.
Freshly reproduced anomaly and patch verification, running 2.6.23-rc3 with your config, both with and without Ingo's patch reverted:
I did update to 2.6.23-rc3-git1 first, but I ended up reverting the patch, as I didn't notice it had been applied already. Sorry about that. With this patch the underflows are gone, but there are still the overflows, so the questions from the last mail still remain.
bye, Roman
Re: CFS review
In reply to Roman ZippelQuoted 9 lines · Roman Zippel
Hi,
Quoted 2 lines · Willy Tarreau
fortunately all bug reporters are not like you. It's amazing how long you can resist sending a simple bug report to a developer!
I'm more amazed how long Ingo can resist providing some explanations (not just about this problem).
It's a matter of time balance. It takes a short time to send the output of a script, and it takes a very long time to explain how things work. I often encounter the same situation with haproxy. People ask me to explain them in detail how this or that would apply to their context, and it's often easier for me to provide them with a 5-lines patch to add the feature they need, than to spend half an hour explaining why and how it would badly behave.
Quoted 3 lines
It's not like I haven't given him anything, he already has the test programs, he already knows the system configuration. Well, I've sent him the stuff now...
fine, thanks.
Quoted 6 lines
Quoted 3 lines
Maybe you
consider that you need to fix the bug by yourself after you understand the code,Fixing the bug requires some knowledge what the code is intended to do.
Quoted 8 lines
Quoted 3 lines
Please try to be a little bit more transparent if you really want the bugs fixed, and don't behave as if you wanted this bug to survive till -final.
Could you please ask Ingo the same? I'm simply trying to get some transparancy into the CFS design. Without further information it's difficult to tell, whether something is supposed to work this way or it's a bug.
I know that Ingo tends to reply to a question with another question. But as I said, imagine if he has to explain the same things to each person who asks him for it. I think that a more constructive approach would be to point what is missing/unclear/inexact in the doc so that he adds some paragraphs for you and everyone else. If you need this information to debug, most likely other people will need it too.
Quoted 4 lines
In this case it's quite possible that due to a recent change my testcase doesn't work anymore. Should I consider the problem fixed or did it just go into hiding? Without more information it's difficult to verify this independently.
generally, problems that appear only on one person's side and which suddenly disappear are either caused by some random buggy patch left in the tree (not your case it seems), or by an obscure bug of the feature being tested which will resurface from time to time as long as it's not identified.
Willy
Re: CFS review
In reply to Roman ZippelQuoted 1 line · Roman Zippel
Hi,
Greetings,
Quoted 12 lines · Ingo Molnar
Quoted 10 lines
just to make sure, how does 'top' output of the l + "lt 3" testcase look like now on your laptop? Yesterday it was this:
4544 roman 20 0 1796 520 432 S 32.1 0.4 0:21.08 lt 4545 roman 20 0 1796 344 256 R 32.1 0.3 0:21.07 lt 4546 roman 20 0 1796 344 256 R 31.7 0.3 0:21.07 lt 4547 roman 20 0 1532 272 216 R 3.3 0.2 0:01.94 land i'm still wondering how that output was possible.
Quoted 9 lines
I disabled the jiffies logic and the result is still the same, so this problem isn't related to resolution at all.
I traced it a little and what's happing is that the busy loop really only gets little time, it only runs inbetween the timer tasks. When the timer task is woken up__enqueue_sleeper()updatessleeper_bonusand a little later when the busy loop is preempted__update_curr()is called a last time and it's fully hit by thesleeper_bonus. So the timer tasks use less time than they actually get and thus produce overflows, the busy loop OTOH is punished and underflows.
I still can't reproduce this here. Can you please send your .config, so I can try again with a config as close to yours as possible?
-Mike
Re: CFS review
In reply to Roman ZippelQuoted 8 lines · Roman Zippel
[...] e.g. in this example there are three tasks that run only for about 1ms every 3ms, but they get far more time than should have gotten fairly:
4544 roman 20 0 1796 520 432 S 32.1 0.4 0:21.08 lt 4545 roman 20 0 1796 344 256 R 32.1 0.3 0:21.07 lt 4546 roman 20 0 1796 344 256 R 31.7 0.3 0:21.07 lt 4547 roman 20 0 1532 272 216 R 3.3 0.2 0:01.94 l
Mike and me have managed to reproduce similarly looking 'top' output, but it takes some effort: we had to deliberately run a non-TSC sched_clock(), CONFIG_HZ=100, !CONFIG_NO_HZ and !CONFIG_HIGH_RES_TIMERS.
in that case 'top' accounting symptoms similar to the above are not due to the scheduler starvation you suspected, but due the effect of a low-resolution scheduler clock and a tightly coupled timer/scheduler tick to it. I tried the very same workload on 2.6.22 (with the same .config) and i saw similarly anomalous 'top' output. (Not only can one create really anomalous CPU usage, one can completely hide tasks from 'top' output.)
if your test-box has a high-resolution sched_clock() [easily possible] then please send us the lt.c and l.c code so that we can have a look.
Ingo
Re: CFS review
Hi,
Quoted 4 lines · Ingo Molnar
Quoted 4 lines
[...] e.g. in this example there are three tasks that run only for about 1ms every 3ms, but they get far more time than should have gotten fairly:
Quoted 8 lines
Quoted 4 lines
4544 roman 20 0 1796 520 432 S 32.1 0.4 0:21.08 lt 4545 roman 20 0 1796 344 256 R 32.1 0.3 0:21.07 lt 4546 roman 20 0 1796 344 256 R 31.7 0.3 0:21.07 lt 4547 roman 20 0 1532 272 216 R 3.3 0.2 0:01.94 lMike and me have managed to reproduce similarly looking 'top' output, but it takes some effort: we had to deliberately run a non-TSC
sched_clock(),CONFIG_HZ=100, !CONFIG_NO_HZ and !CONFIG_HIGH_RES_TIMERS.
I used my old laptop for these tests, where tsc is indeed disabled due to instability. Otherwise the kernel was configured with CONFIG_HZ=1000.
Quoted 4 lines
in that case 'top' accounting symptoms similar to the above are not due to the scheduler starvation you suspected, but due the effect of a low-resolution scheduler clock and a tightly coupled timer/scheduler tick to it.
Well, it magnifies the rounding problems in CFS.
I mainly wanted to test a little the behaviour of CFS and I thought a saw patch which enabled the use of TSC in these cases, so I didn't check sched_clock().
Anyway, I want to point out that this wasn't the main focus of what I wrote.
bye, Roman
Re: CFS review
Quoted 11 lines · Roman Zippel
Quoted 9 lines · Ingo Molnar
Quoted 8 lines
[...] e.g. in this example there are three tasks that run only for about 1ms every 3ms, but they get far more time than should have gotten fairly:
4544 roman 20 0 1796 520 432 S 32.1 0.4 0:21.08 lt 4545 roman 20 0 1796 344 256 R 32.1 0.3 0:21.07 lt 4546 roman 20 0 1796 344 256 R 31.7 0.3 0:21.07 lt 4547 roman 20 0 1532 272 216 R 3.3 0.2 0:01.94 l
Quoted 7 lines
Quoted 3 lines
Mike and me have managed to reproduce similarly looking 'top' output, but it takes some effort: we had to deliberately run a non-TSC
sched_clock(),CONFIG_HZ=100, !CONFIG_NO_HZ and !CONFIG_HIGH_RES_TIMERS.I used my old laptop for these tests, where tsc is indeed disabled due to instability. Otherwise the kernel was configured with
CONFIG_HZ=1000.
please send all the debug info and source code we asked for - thanks!
Ingo
Re: CFS review
In reply to Roman ZippelQuoted 6 lines · Roman Zippel
Quoted 4 lines
in that case 'top' accounting symptoms similar to the above are not due to the scheduler starvation you suspected, but due the effect of a low-resolution scheduler clock and a tightly coupled timer/scheduler tick to it.
Well, it magnifies the rounding problems in CFS.
why do you say that? 2.6.22 behaves similarly with a low-res sched_clock(). This has nothing to do with 'rounding problems'!
i tried your fl.c and if sched_clock() is high-resolution it's scheduled _perfectly_ by CFS:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 5906 mingo 20 0 1576 244 196 R 71.2 0.0 0:30.11 l 5909 mingo 20 0 1844 344 260 S 9.6 0.0 0:04.02 lt 5907 mingo 20 0 1844 508 424 S 9.5 0.0 0:04.01 lt 5908 mingo 20 0 1844 344 260 S 9.5 0.0 0:04.02 lt
if sched_clock() is low-resolution then indeed the 'lt' tasks will "hide":
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
2366 mingo 20 0 1576 248 196 R 99.9 0.0 0:07.95 loop_silent
1 root 20 0 2132 636 548 S 0.0 0.0 0:04.64 initbut that's nothing new. CFS cannot conjure up time measurement methods that do not exist. If you have a low-res clock and if you create an app that syncs precisely to the tick of that clock via timers that run off that exact tick then there's nothing the scheduler can do about it. It is false to charachterise this as 'sleeper starvation' or 'rounding error' like you did. No amount of rounding logic can create a high-resolution clock out of thin air.
Ingo
Re: CFS review
Quoted 8 lines
but that's nothing new. CFS cannot conjure up time measurement methods that do not exist. If you have a low-res clock and if you create an app that syncs precisely to the tick of that clock via timers that run off that exact tick then there's nothing the scheduler can do about it. It is false to charachterise this as 'sleeper starvation' or 'rounding error' like you did. No amount of rounding logic can create a high-resolution clock out of thin air.
CFS is only as fair as your clock is good.
Re: CFS review
In reply to Ingo MolnarHi,
Quoted 26 lines · Ingo Molnar
Quoted 6 lines
Quoted 4 lines
in that case 'top' accounting symptoms similar to the above are not due to the scheduler starvation you suspected, but due the effect of a low-resolution scheduler clock and a tightly coupled timer/scheduler tick to it.
Well, it magnifies the rounding problems in CFS.
why do you say that? 2.6.22 behaves similarly with a low-res
sched_clock(). This has nothing to do with 'rounding problems'!i tried your
fl.cand ifsched_clock()is high-resolution it's scheduled _perfectly_ by CFS:PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 5906 mingo 20 0 1576 244 196 R 71.2 0.0 0:30.11 l 5909 mingo 20 0 1844 344 260 S 9.6 0.0 0:04.02 lt 5907 mingo 20 0 1844 508 424 S 9.5 0.0 0:04.01 lt 5908 mingo 20 0 1844 344 260 S 9.5 0.0 0:04.02 ltif
sched_clock()is low-resolution then indeed the 'lt' tasks will "hide":PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 2366 mingo 20 0 1576 248 196 R 99.9 0.0 0:07.95 loop_silent 1 root 20 0 2132 636 548 S 0.0 0.0 0:04.64 init
Quoted 7 lines
but that's nothing new. CFS cannot conjure up time measurement methods that do not exist. If you have a low-res clock and if you create an app that syncs precisely to the tick of that clock via timers that run off that exact tick then there's nothing the scheduler can do about it. It is false to charachterise this as 'sleeper starvation' or 'rounding error' like you did. No amount of rounding logic can create a high-resolution clock out of thin air.
Please calm down. You apparantly already get worked up about one of the secondary problems. I didn't say 'sleeper starvation' or 'rounding error', these are your words and it's your perception of what I said.
sched_clock() can have a low resolution, which can be a problem for the scheduler. This is all this program demonstrates. If and how this problem should be solved is a completely different issue, about which I haven't said anything yet and since it's not that important right now I'll leave it at that for now.
bye, Roman
Re: CFS review
Quoted 24 lines · Roman Zippel
Quoted 16 lines
i tried your
fl.cand ifsched_clock()is high-resolution it's scheduled _perfectly_ by CFS:PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 5906 mingo 20 0 1576 244 196 R 71.2 0.0 0:30.11 l 5909 mingo 20 0 1844 344 260 S 9.6 0.0 0:04.02 lt 5907 mingo 20 0 1844 508 424 S 9.5 0.0 0:04.01 lt 5908 mingo 20 0 1844 344 260 S 9.5 0.0 0:04.02 ltif
sched_clock()is low-resolution then indeed the 'lt' tasks will "hide":PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 2366 mingo 20 0 1576 248 196 R 99.9 0.0 0:07.95 loop_silent 1 root 20 0 2132 636 548 S 0.0 0.0 0:04.64 initQuoted 7 lines
but that's nothing new. CFS cannot conjure up time measurement methods that do not exist. If you have a low-res clock and if you create an app that syncs precisely to the tick of that clock via timers that run off that exact tick then there's nothing the scheduler can do about it. It is false to charachterise this as 'sleeper starvation' or 'rounding error' like you did. No amount of rounding logic can create a high-resolution clock out of thin air.
Quoted 2 lines
[...] I didn't say 'sleeper starvation' or 'rounding error', these are your words and it's your perception of what I said.
Oh dear :-) It was indeed my preception that yesterday you said:
| A problem here is that this can be exploited, if a job is spread over | ^^^^^^^^^^^^^^^^^^^^^ | a few threads, they can get more time relativ to other tasks, e.g. in | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | this example there are three tasks that run only for about 1ms every | 3ms, but they get far more time than should have gotten fairly: | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | 4544 roman 20 0 1796 520 432 S 32.1 0.4 0:21.08 lt | 4545 roman 20 0 1796 344 256 R 32.1 0.3 0:21.07 lt | 4546 roman 20 0 1796 344 256 R 31.7 0.3 0:21.07 lt | 4547 roman 20 0 1532 272 216 R 3.3 0.2 0:01.94 l
[ http://lkml.org/lkml/2007/7/31/668 ]
( the underlined portion, in other words, is called 'starvation'.)
And again today, i clearly perceived you to say:
| > in that case 'top' accounting symptoms similar to the above are not | > due to the scheduler starvation you suspected, but due the effect of | > a low-resolution scheduler clock and a tightly coupled | > timer/scheduler tick to it. | | Well, it magnifies the rounding problems in CFS.
[ http://lkml.org/lkml/2007/8/1/153 ]
But you are right, that must be my perception alone, you couldnt possibly have said any of that =B-)
Or are you perhaps one of those who claims that saying something analogous to sleeper starvation does not equal to talking about 'sleeper starvation' and saying something about 'rounding problems in CFS' does in no way mean you were talking about rounding errors? :-)
Ingo
Re: CFS review
Hi,
Quoted 4 lines · Ingo Molnar
Quoted 2 lines
[...] I didn't say 'sleeper starvation' or 'rounding error', these are your words and it's your perception of what I said.
Oh dear :-) It was indeed my preception that yesterday you said:
*sigh* and here you go off again nitpicking on a minor issue just to prove your point...
When I wrote the earlier stuff I hadn't realized it was resolution related, so things have to be put into proper context and you make it yourself a little easy by equating them.
Yippi, you found another small error I made, can we drop this now? Please?
bye, Roman
Re: CFS review
In reply to Ingo MolnarQuoted 7 lines · Ingo Molnar
Quoted 4 lines · Roman Zippel
[...] e.g. in this example there are three tasks that run only for about 1ms every 3ms, but they get far more time than should have gotten fairly:
Quoted 8 lines
Quoted 4 lines
4544 roman 20 0 1796 520 432 S 32.1 0.4 0:21.08 lt 4545 roman 20 0 1796 344 256 R 32.1 0.3 0:21.07 lt 4546 roman 20 0 1796 344 256 R 31.7 0.3 0:21.07 lt 4547 roman 20 0 1532 272 216 R 3.3 0.2 0:01.94 lMike and me have managed to reproduce similarly looking 'top' output, but it takes some effort: we had to deliberately run a non-TSC
sched_clock(),CONFIG_HZ=100, !CONFIG_NO_HZ and !CONFIG_HIGH_RES_TIMERS.
..which is pretty much the state of play for lots of non-x86 hardware.
Signature · 1 line
Mathematics is the supreme nostalgia of our time.
Re: CFS review
Quoted 13 lines · Matt Mackall
Quoted 12 lines · Ingo Molnar
Quoted 8 lines · Roman Zippel
[...] e.g. in this example there are three tasks that run only for about 1ms every 3ms, but they get far more time than should have gotten fairly:
4544 roman 20 0 1796 520 432 S 32.1 0.4 0:21.08 lt 4545 roman 20 0 1796 344 256 R 32.1 0.3 0:21.07 lt 4546 roman 20 0 1796 344 256 R 31.7 0.3 0:21.07 lt 4547 roman 20 0 1532 272 216 R 3.3 0.2 0:01.94 l
Quoted 5 lines
Quoted 3 lines
Mike and me have managed to reproduce similarly looking 'top' output, but it takes some effort: we had to deliberately run a non-TSC
sched_clock(),CONFIG_HZ=100, !CONFIG_NO_HZ and !CONFIG_HIGH_RES_TIMERS...which is pretty much the state of play for lots of non-x86 hardware.
question is if it's significantly worse than before. With a 100 or 1000Hz timer, you can't expect perfect fairness just due to the extremely rough measurement of time spent...
Re: CFS review
Quoted 18 lines · Arjan van de Ven
Quoted 17 lines · Matt Mackall
Quoted 15 lines · Ingo Molnar
Quoted 8 lines · Roman Zippel
[...] e.g. in this example there are three tasks that run only for about 1ms every 3ms, but they get far more time than should have gotten fairly:
4544 roman 20 0 1796 520 432 S 32.1 0.4 0:21.08 lt 4545 roman 20 0 1796 344 256 R 32.1 0.3 0:21.07 lt 4546 roman 20 0 1796 344 256 R 31.7 0.3 0:21.07 lt 4547 roman 20 0 1532 272 216 R 3.3 0.2 0:01.94 lMike and me have managed to reproduce similarly looking 'top' output, but it takes some effort: we had to deliberately run a non-TSC
sched_clock(),CONFIG_HZ=100, !CONFIG_NO_HZ and !CONFIG_HIGH_RES_TIMERS.
Quoted 5 lines
Quoted 1 line
..which is pretty much the state of play for lots of non-x86 hardware.
question is if it's significantly worse than before. With a 100 or 1000Hz timer, you can't expect perfect fairness just due to the extremely rough measurement of time spent...
Well, at least we're able to *measure* that task 'l' used 3.3% and that tasks 'lt' used 32%. If we're able to measure it, then that's already fine enough to be able to adjust future timeslices credits. Granted it may be rough for small periods (a few jiffies), but it should be fair for larger periods. Or at least it should *report* some fair distribution.
Willy
Re: CFS review
Quoted 19 lines · Willy Tarreau
Quoted 18 lines · Arjan van de Ven
Quoted 17 lines · Matt Mackall
Quoted 15 lines · Ingo Molnar
Quoted 8 lines · Roman Zippel
[...] e.g. in this example there are three tasks that run only for about 1ms every 3ms, but they get far more time than should have gotten fairly:
4544 roman 20 0 1796 520 432 S 32.1 0.4 0:21.08 lt 4545 roman 20 0 1796 344 256 R 32.1 0.3 0:21.07 lt 4546 roman 20 0 1796 344 256 R 31.7 0.3 0:21.07 lt 4547 roman 20 0 1532 272 216 R 3.3 0.2 0:01.94 lMike and me have managed to reproduce similarly looking 'top' output, but it takes some effort: we had to deliberately run a non-TSC
sched_clock(),CONFIG_HZ=100, !CONFIG_NO_HZ and !CONFIG_HIGH_RES_TIMERS.
Quoted 8 lines
Quoted 5 lines
Quoted 1 line
..which is pretty much the state of play for lots of non-x86 hardware.
question is if it's significantly worse than before. With a 100 or 1000Hz timer, you can't expect perfect fairness just due to the extremely rough measurement of time spent...
Well, at least we're able to *measure* that task 'l' used 3.3% and that tasks 'lt' used 32%.
It's not measured if you use jiffies level stuff. It's at best sampled!
Quoted 4 lines
If we're able to measure it, then that's
already fine enough to be able to adjust future timeslices credits. Granted it may be rough for small periods (a few jiffies), but it should be fair for larger periods. Or at least it should *report*
but the testcase here uses a LOT shorter time than jiffies... not "a few jiffies".
Signature · 2 lines
if you want to mail me at work (you don't), use arjan (at) linux.intel.com Test the interaction between Linux and your BIOS via http://www.linuxfirmwarekit.org
Re: CFS review
Quoted 22 lines · Arjan van de Ven
Quoted 21 lines · Willy Tarreau
Quoted 20 lines · Arjan van de Ven
Quoted 18 lines · Matt Mackall
Quoted 7 lines · Ingo Molnar
Quoted 4 lines · Roman Zippel
[...] e.g. in this example there are three tasks that run only for about 1ms every 3ms, but they get far more time than should have gotten fairly:
Quoted 8 lines
Quoted 4 lines
4544 roman 20 0 1796 520 432 S 32.1 0.4 0:21.08 lt 4545 roman 20 0 1796 344 256 R 32.1 0.3 0:21.07 lt 4546 roman 20 0 1796 344 256 R 31.7 0.3 0:21.07 lt 4547 roman 20 0 1532 272 216 R 3.3 0.2 0:01.94 lMike and me have managed to reproduce similarly looking 'top' output, but it takes some effort: we had to deliberately run a non-TSC
sched_clock(),CONFIG_HZ=100, !CONFIG_NO_HZ and !CONFIG_HIGH_RES_TIMERS...which is pretty much the state of play for lots of non-x86 hardware.
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
question is if it's significantly worse than before. With a 100 or 1000Hz timer, you can't expect perfect fairness just due to the extremely rough measurement of time spent...
Well, at least we're able to *measure* that task 'l' used 3.3% and that tasks 'lt' used 32%.
It's not measured if you use jiffies level stuff. It's at best sampled!
But if we rely on the same sampling method, at least we will report something consistent with what happens. And sampling is often the correct method to get finer resolution on a macroscopic scale.
I mean, we're telling users that we include the "completely fair scheduler" in 2.6.23, a scheduler which will ensure that all tasks get a fair share of CPU time. A user starts top and sees 33%+32%+32+3% for 4 tasks while he would have expected to see 25%+25%+25%+25%. You can try to explain users that it's the fairest distribution, but they will have a hard time believing it, especially when they measure the time spent on CPU with the "time" command. OK this is all sampling, but we should try to avoid relying on different sources of data for computation and reporting. Time and Top should report something close to 4*25% for comparable tasks. And if not, because of some sampling problem, maybe the scheduler cannot be that fair in some situations, but either it should make use of the sampling time and top use, or top and time should rely on the view of the scheduler.
I'll try to quickly hack up a program which makes use of rdtsc from userspace to precisely measure user-space time, and disable TSC use from the kernel to see how the values diverge.
Regards,
Willy
Re: CFS review
In reply to Arjan van de VenQuoted 18 lines · Arjan van de Ven
Quoted 17 lines · Matt Mackall
Quoted 15 lines · Ingo Molnar
Quoted 8 lines · Roman Zippel
[...] e.g. in this example there are three tasks that run only for about 1ms every 3ms, but they get far more time than should have gotten fairly:
4544 roman 20 0 1796 520 432 S 32.1 0.4 0:21.08 lt 4545 roman 20 0 1796 344 256 R 32.1 0.3 0:21.07 lt 4546 roman 20 0 1796 344 256 R 31.7 0.3 0:21.07 lt 4547 roman 20 0 1532 272 216 R 3.3 0.2 0:01.94 lMike and me have managed to reproduce similarly looking 'top' output, but it takes some effort: we had to deliberately run a non-TSC
sched_clock(),CONFIG_HZ=100, !CONFIG_NO_HZ and !CONFIG_HIGH_RES_TIMERS.
Quoted 5 lines
Quoted 1 line
..which is pretty much the state of play for lots of non-x86 hardware.
question is if it's significantly worse than before. With a 100 or 1000Hz timer, you can't expect perfect fairness just due to the extremely rough measurement of time spent...
Indeed. I'm just pointing out that not having TSC, fast HZ, no-HZ mode, or high-res timers should not be treated as an unusual circumstance. That's a PC-centric view.
Signature · 1 line
Mathematics is the supreme nostalgia of our time.
Re: CFS review
Quoted 4 lines · Matt Mackall
Indeed. I'm just pointing out that not having TSC, fast HZ, no-HZ mode, or high-res timers should not be treated as an unusual circumstance. That's a PC-centric view.
The question is if it would be that hard to add TSC equivalent sched_clock() support to more systems. At least a lot of CPUs I have ever looked at had some kind of fast clock available. Perhaps it's more laziness of the developers or cut'n'paste that these are not as widely used as they should be?
-Andi
Re: CFS review
In reply to Matt MackallQuoted 7 lines · Matt Mackall
Quoted 3 lines
question is if it's significantly worse than before. With a 100 or 1000Hz timer, you can't expect perfect fairness just due to the extremely rough measurement of time spent...
Indeed. I'm just pointing out that not having TSC, fast HZ, no-HZ mode, or high-res timers should not be treated as an unusual circumstance. That's a PC-centric view.
actually, you dont need high-res or fast HZ or TSC to reduce those timer
artifacts: all you need is _two_ (low-res, slow) hw clocks.
Most platforms do have that (even the really really cheap ones), but arches do not set up the scheduler tick one of them and the timer tick to the other, and to skew the periodic-timer programming setup a bit (by nature of physics they are usually already skewed a bit) so that the scheduler tick and timer tick are not coupled. This whole thing is not a big deal on embedded anyway. (you dont get students log in to the toaster or to the fridge to run timer exploits, do you? :-)
Ingo
Re: CFS review
In reply to Roman ZippelQuoted 11 lines · Roman Zippel
[...] the increase in code size:
2.6.22:
text data bss dec hex filename
10150 24 3344 13518 34cekernel/sched.orecent git:
text data bss dec hex filename
14724 228 2020 16972 424ckernel/sched.oThat's i386 without stats/debug. [...]
that's without CONFIG_SMP, right? :-) On SMP they are about net break even:
text data bss dec hex filename
26535 4173 24 30732 780c kernel/sched.o-2.6.22
28378 2574 16 30968 78f8 kernel/sched.o-2.6.23-git(plus a further ~1.5K per CPU data reduction which is not visible here)
btw., here's the general change in size of a generic vmlinux from .22 to .23-git, using the same .config:
text data bss dec hex filename
5256628 520760 1331200 7108588 6c77ec vmlinux.22 5306918 535844 1327104 7169866 6d674a vmlinux.23-git
+50K. (this was on UP)
In any case, there's still some debugging code in the scheduler (beyond SCHED_DEBUG), i'll work some more on reducing it.
Ingo
Re: CFS review
Hi,
Quoted 12 lines · Ingo Molnar
Quoted 10 lines · Roman Zippel
[...] the increase in code size:
2.6.22:
text data bss dec hex filename
10150 24 3344 13518 34cekernel/sched.orecent git:
text data bss dec hex filename
14724 228 2020 16972 424ckernel/sched.o
Quoted 8 lines
Quoted 1 line
That's i386 without stats/debug. [...]
that's without
CONFIG_SMP, right? :-) On SMP they are about net break even:text data bss dec hex filename 26535 4173 24 30732 780c kernel/sched.o-2.6.22 28378 2574 16 30968 78f8 kernel/sched.o-2.6.23-git
That's still quite an increase in some rather important code paths and it's not just the code size, but also code complexity which is important
- a major point I tried to address in my review.
Quoted 1 line
(plus a further ~1.5K per CPU data reduction which is not visible here)
That's why I mentioned the increased runtime memory usage...
bye, Roman
Re: CFS review
In reply to Roman ZippelQuoted 3 lines · Roman Zippel
especially if one already knows that
scheduler clock has only limited resolution (because it's based on jiffies), it becomes possible to use mostly 32bit values.
jiffies based sched_clock should be soon very rare. It's probably not worth optimizing for it.
-Andi
Re: CFS review
Hi,
Quoted 6 lines · Andi Kleen
Quoted 3 lines
especially if one already knows that
scheduler clock has only limited resolution (because it's based on jiffies), it becomes possible to use mostly 32bit values.jiffies based
sched_clockshould be soon very rare. It's probably not worth optimizing for it.
I'm not so sure about that. sched_clock() has to be fast, so many archs may want to continue to use jiffies. As soon as one does that one can also save a lot of computational overhead by using 32bit instead of 64bit. The question is then how easy that is possible.
bye, Roman
Re: CFS review
Quoted 5 lines · Roman Zippel
Quoted 2 lines
jiffies based
sched_clockshould be soon very rare. It's probably not worth optimizing for it.I'm not so sure about that.
sched_clock()has to be fast, so many archs may want to continue to use jiffies. [...]
i think Andi was talking about the vast majority of the systems out there. For example, check out the arch demography of current Fedora installs (according to the Smolt opt-in UUID based user metrics):
http://smolt.fedoraproject.org/
i686: 74743
x86_64: 18599
i386: 1208
ppc: 527
ppc64: 396
sparc64: 14
---------------
Total: 95488
even pure i386 (kernels, not systems) is a only 1.2% of all installs. By the time the CFS kernel gets into a distro (a few months at minimum, typically a year) this percentage will go down further. And embedded doesnt really care about task-statistics corner cases [ (it likely doesnt have 'top' installed - likely doesnt even have /proc mounted or even built in ;-) ].
of course CFS should not do _worse_ stats than what we had before, and should not break or massively misbehave. Also, anything sane we can do for low-resolution arches we should do (and we already do quite a bit - the while wmult stuff is to avoid expensive divisions) - and i regularly booted CFS with a low-resolution clock to make sure it works. So i'm not trying to duck anything, we've just got to keep our design priorities right :-)
Ingo
Re: CFS review
Quoted 6 lines · Ingo Molnar
Quoted 3 lines · Roman Zippel
Quoted 2 lines
jiffies based
sched_clockshould be soon very rare. It's probably not worth optimizing for it.
Quoted 6 lines
Quoted 2 lines
I'm not so sure about that.
sched_clock()has to be fast, so many archs may want to continue to use jiffies. [...]i think Andi was talking about the vast majority of the systems out there. For example, check out the arch demography of current Fedora installs (according to the Smolt opt-in UUID based user metrics):
I meant that in many cases where the TSC is considered unreliable today it'll be possible to use it anyways at least for sched_clock() (and possibly even gtod())
The exception would be system which really have none, but there should be very few of those.
-Andi
Re: CFS review
In reply to Roman ZippelQuoted 5 lines · Roman Zippel
I'm not so sure about that.
sched_clock()has to be fast, so many archs may want to continue to use jiffies. As soon as one does that one can also save a lot of computational overhead by using 32bit instead of 64bit. The question is then how easy that is possible.
I have to say, it would be interesting to try to use 32-bit arithmetic.
I also think it's likely a mistake to do a nanosecond resolution. That's part of what forces us to 64 bits, and it's just not even an *interesting* resolution.
It would be better, I suspect, to make the scheduler clock totally distinct from the other clock sources (many architectures have per-cpu cycle counters), and *not* try to even necessarily force it to be a "time-based" one.
So I think it would be entirely appropriate to
- do something that *approximates* microseconds.
Using microseconds instead of nanoseconds would likely allow us to do 32-bit arithmetic in more areas, without any real overflow.
And quite frankly, even on fast CPU's, the scheduler is almost certainly not going to be able to take any advantage of the nanosecond resolution. Just about anything takes a microsecond - including IO. I don't think nanoseconds are worth the ten extra bits they need, if we could do microseconds in 32 bits.
And the "approximates" thing would be about the fact that we don't actually care about "absolute" microseconds as much as something that is in the "roughly a microsecond" area. So if we say "it doesn't have to be microseconds, but it should be within a factor of two of a ms", we could avoid all the expensive divisions (even if they turn into multiplications with reciprocals), and just let people *shift* the CPU counter instead.
In fact, we could just say that we don't even care about CPU counters that shift frequency - so what? It gets a bit further off the "ideal microsecond", but the scheduler just cares about _relative_ times between tasks (and that the total latency is within some reasonable value), it doesn't really care about absolute time.
Hmm?
It would still be true that something that is purely based on timer ticks will always be liable to have rounding errors that will inevitably mean that you don't get good fairness - tuning threads to run less than a timer tick at a time would effectively "hide" them from the scheduler accounting. However, in the end, I think that's pretty much unavoidable. We should make sure that things mostly *work* for that situation, but I think it's ok to say that the *quality* of the fairness will obviously suffer (and possibly a lot in the extreme cases).
Linus
Re: CFS review
Quoted 9 lines · Linus Torvalds
Quoted 5 lines · Roman Zippel
I'm not so sure about that.
sched_clock()has to be fast, so many archs may want to continue to use jiffies. As soon as one does that one can also save a lot of computational overhead by using 32bit instead of 64bit. The question is then how easy that is possible.
Quoted 5 lines
I have to say, it would be interesting to try to use 32-bit arithmetic.
I also think it's likely a mistake to do a nanosecond resolution. That's part of what forces us to 64 bits, and it's just not even an *interesting* resolution.
I would add that I have been bothered by the 64-bit arithmetics when trying to see what could be improved in the code. In fact, it's very hard to optimize anything when you have arithmetics on integers larger than the CPU's, and gcc is known not to emit very good code in this situation (I remember it could not play with registers renaming, etc...).
However, I undertand why Ingo chose to use 64 bits. It has the advantage that the numbers never wrap within 584 years. I'm well aware that it's very difficult to keep tasks ordered according to a key which can wrap.
But if we consider that we don't need to be more precise than the return value from gettimeofday() that all applications use, we see that a bunch of microseconds is enough. 32 bits at the microsecond level wraps around every hour. We may accept to recompute all keys every hour. It's not that dramatic. The problem is how to detect that we will need to.
I remember a trick used by Tim Schmielau in his jiffies64 patch for 2.4. He kept a copy of the highest bit of the lower word in the lowest bit of the higher word, and considered that the lower one could not wrap before we could check it. I liked this approach, which could be translated here in something like the following :
Have all keys use 32-bit resolution, and monitor the 32nd bit. All tasks must have the same value in this bit, otherwise we consider that their keys have wrapped. The "current" value of this bit is copied somewhere. When we walk the tree and find a task with a key which does not have its 32nd bit equal to the current value, it means that this key has wrapped, so we have to use this information in our arithmetics.
When all keys have their 32nd bit different from the "current" value, then we switch this value to reflect the new 32nd bit, and everything is in sync again. The only requirement is that no key wraps around before the "current" value is switched. This implies that no couple of tasks could have their keys distant by more than 31 bits (35 minutes), which seems reasonable. If we can recompute all tasks' keys when all of them have wrapped, then we do not have to store the "current" bit value anymore, and consider that it is always zero instead (I don't know if the code permits this).
It is possible that using the 32nd bit to detect the wrapping may impose us to perform some computations on 33 bits. If this is the case, then it would be fine if we reduced the range to 31 bits, with all tasks distant from at most 30 bits (17 minutes).
Also, I remember that the key is signed. I've never experimented with the tricks above on signed values, but we might be able to define something like this for the higher bits :
00 = positive, no wrap
01 = positive, wrapped
10 = negative, wrapped
11 = negative, no wrap
I have no code to show, I just wanted to expose this idea. I know that if Ingo likes it, he will beat everyone at implementing it ;-)
Quoted 1 line
Linus
Willy
Re: CFS review
Quoted 1 line · Willy Tarreau
(I remember it could not play with registers renaming, etc...).
This has changed in recent gccs. It doesn't force register pairs anymore. Given the code is still not that good, but some of the worst sins are gone
Quoted 3 lines
However, I undertand why Ingo chose to use 64 bits. It has the advantage that the numbers never wrap within 584 years. I'm well aware that it's very difficult to keep tasks ordered according to a key which can wrap.
If you define an appropiate window and use some macros for the comparisons it shouldn't be a big problem.
Quoted 2 lines
But if we consider that we don't need to be more precise than the return value from
gettimeofday()that all applications use,
gettimeofday() has too strict requirements, that make it unnecessarily slow for this task.
Quoted 1 line
every hour. We may accept to recompute all keys every hour.
You don't need to recompute keys; just use careful comparisons using subtractions and a window. TCPs have done that for decades.
Quoted 1 line
Have all keys use 32-bit resolution, and monitor the 32nd bit. All tasks
If you're worried about wrapping in one hour why is wrapping in two hours not a problem?
I have one request though. If anybody adds anything complicated for this please make it optional so that 64bit platforms are not burdened by it.
-Andi
Re: CFS review
Quoted 6 lines · Andi Kleen
Quoted 3 lines
However, I undertand why Ingo chose to use 64 bits. It has the advantage that the numbers never wrap within 584 years. I'm well aware that it's very difficult to keep tasks ordered according to a key which can wrap.
If you define an appropiate window and use some macros for the comparisons it shouldn't be a big problem.
It should not, but the hardest thing is often to keep values sorted within a window. When you store your values in a tree according to a key, it's not always easy to do find the first one relative to a sliding offset.
Quoted 5 lines
Quoted 2 lines
But if we consider that we don't need to be more precise than the return value from
gettimeofday()that all applications use,
gettimeofday()has too strict requirements, that make it unnecessarily slow for this task.
maybe we would use (TSC >> (x bits)) when TSC is available, or jiffies in other cases. I believe that people not interested in high time accuracies are not much interested in perfect fairness either. However, we should do the best to avoid any form of starvation, otherwise we jump back to the problem with the current scheduler.
Quoted 9 lines
Quoted 1 line
every hour. We may accept to recompute all keys every hour.
You don't need to recompute keys; just use careful comparisons using subtractions and a window. TCPs have done that for decades.
Quoted 1 line
Have all keys use 32-bit resolution, and monitor the 32nd bit. All tasks
If you're worried about wrapping in one hour why is wrapping in two hours not a problem?
I've not said I was worried about that (or maybe I explained myself poorly). Even if it was once a minute, it would not bother me. I wanted to explain that if the solution requires to do it that often, it should be acceptable.
Quoted 3 lines
I have one request though. If anybody adds anything complicated for this please make it optional so that 64bit platforms are not burdened by it.
Fair enough. But the solution is not there yet. Maybe once it's there, it will be better than current design for all platforms and the only difference will be the accuracy due to optional use of the TSC.
Quoted 1 line
-Andi
Willy
Re: CFS review
In reply to Linus TorvaldsQuoted 4 lines · Linus Torvalds
It would be better, I suspect, to make the scheduler clock totally distinct from the other clock sources (many architectures have per-cpu cycle counters), and *not* try to even necessarily force it to be a "time-based" one.
yeah. Note that i largely detached sched_clock() from the GTOD clocksources already in CFS, so part of this is already implemented and the intention is clear. For example, when the following happens:
Marking TSC unstable due to: possible TSC halt in C2. Clocksource tsc unstable (delta = -71630388 ns)
sched_clock() does _not_ stop using the TSC. It is very careful with the TSC value, it checks against wraps, jumping, etc. (the whole rq_clock() wrapper around sched_clock()), but still tries to use the highest resolution time source possible, even if that time source is not good enough for GTOD's purposes anymore. So the scheduler clock is already largely detached from other clocksources in the system.
Quoted 6 lines
It would still be true that something that is purely based on timer ticks will always be liable to have rounding errors that will inevitably mean that you don't get good fairness - tuning threads to run less than a timer tick at a time would effectively "hide" them from the scheduler accounting. However, in the end, I think that's pretty much unavoidable.
Note that there is a relatively easy way of reducing the effects of such intentional coupling: turn on CONFIG_HIGH_RES_TIMERS. That decouples the scheduler tick from the jiffy tick and works against such 'exploits' - _even_ if the scheduler clock is otherwise low resolution. Also enable CONFIG_NO_HZ and the whole thing (of when the scheduler tick kicks in) becomes very hard to predict.
[ So while in a low-res clock situation scheduling will always be less
precise, with hres-timers and dynticks we have a natural 'random sampler' mechanism so that no task can couple to the scheduler tick - accidentally or even intentionally.
The only 'unavoidable coupling' scenario is when the hardware has only a single, low-resolution time sampling method. (that is pretty rare though, even in the ultra-embedded space. If a box has two independent hw clocks, even if they are low resolution, the timer tick can be decoupled from the scheduler tick.) ]
Quoted 2 lines
I have to say, it would be interesting to try to use 32-bit arithmetic.
yeah. We tried to do as much of that as possible, please read on below for (many) more details. There's no short summary i'm afraid :-/
Most importantly, CFS _already_ includes a number of measures that act against too frequent math. So even though you can see 64-bit math code in it, it's only rarely called if your clock has a low resolution - and that happens all automatically! (see below the details of this buffered delta math)
I have not seen Roman notice and mention any of these important details (perhaps because he was concentrating on finding faults in CFS - which a reviewer should do), but those measures are still very important for a complete, balanced picture, especially if one focuses on overhead on small boxes where the clock is low-resolution.
As Peter has said it in his detailed review of Roman's suggested algorithm, our main focus is on keeping total complexity down - and we are (of course) fundamentally open to changing the math behind CFS, we ourselves tweaked it numerous times, it's not cast into stone in any way, shape or form.
Quoted 3 lines
I also think it's likely a mistake to do a nanosecond resolution. That's part of what forces us to 64 bits, and it's just not even an *interesting* resolution.
yes, very much not interesting, and we did not pick nanoseconds because we find anything "interesting" in that timescale. Firstly, before i go into the thinking behind nanoseconds, microseconds indeed have advantages too, so the choice was not easy, see the arguments in favor of microseconds below at: [*].
There are two fundamental reasons for nanoseconds:
1) they _automatically_ act as a 'carry-over' for fractional math and thus reduce rounding errors. As Roman has noticed we dont care much about math rounding errors in the algorithm: _exactly_ because we *dont have to* care about rounding errors: we've got extra 10 "uninteresting" bits in the time variables to offset the effects of rounding errors and to carry over fractionals.
( Sidenote: in fact we had some simple extra anti-rounding-error
code in CFS and removed it because it made no measurable difference. So even in the current structure there's additional design reserves that we could tap before having to go to another math model. All we need is a testcase that demonstrates rounding errors. Roman's testcase was _not_ a demonstration of math rounding errors, it was about clock granularity! )
2) i tried microseconds resolution once (it's easy) but on fast hw it already showed visible accounting/rounding artifacts in high-frequency scheduling workloads, which, if hw gets just a little bit faster, will become pain.
( Sidenote: if a workload is rescheduling once every few
microseconds, then it very much matters to the balance of things whether there's a fundamental +- 1 microsecond skew on who gets accounted what. In fact the placement of sched_clock() call within schedule() is already visible in practice in some testcases, whether the runqueue-spinlock acquire spinning time is accounted to the 'previous' or the 'next' task - despite that time being sub-microsecond on average. Going to microseconds makes this too coarse. )
I.e. microseconds are on the limit today on fast hardware, and nanoseconds give us an automatic buffer against rounding errors.
On _slow_ hardware, with a low-resolution clock, i very much agree that we should not do too frequent math, and there are already four independent measures that we did in CFS to keep the math overhead down:
Firstly, CFS fundamentally "buffers the math" via deltas, _everywhere_ in the fastpath:
if (unlikely(curr->delta_exec > sysctl_sched_stat_granularity)) {
__update_curr(cfs_rq, curr, now);
curr->delta_exec = 0;
}I.e. we only call the math routines if there was any delta. The beauty is that this "math buffering" works _automatically_ if there is a low-resolution sched_clock() present, because with a low-resolution clock a delta is only observed if a tick happens. I.e. in a high-frequency scheduling workload (the only place where scheduler overhead would be noticeable) all the CFS math is in a rare _slowpath_, that gets triggered only every 10 msecs or so! (if HZ=1000)
I.e. we didnt have to go down the (very painful) path of ktime_t split-model math and we didnt have to introduce a variable precision model for "scheduler time" either, because the delta math itself automatically buffers on slow boxes.
Secondly, note that all the key fastpath variables are already 32-bit (on 32-bit platforms):
long wait_runtime;
unsigned long delta_fair_run;
unsigned long delta_fair_sleep;
unsigned long delta_exec;The _timestamps_ are still 64-bit, but most of the actual math goes on in 32-bit delta variables. That's one of the advantages of doing deltas instead of absolute values.
Thirdly, if even this amount of buffering is not enough for an architecture, CFS also includes the sched_stat_granularity_ns tunable that allows the further reduction of the sampling frequency (and the frequency of us having to do the math) - so if the math overhead is a problem an architecture can set it.
Fourthly, in CFS there is a _single_ 64-bit division, and even for that division, the actual values passed to it are typically in a 32-bit range. Hence we've introduced the following optimization:
static u64 div64_likely32(u64 divident, unsigned long divisor)
{
#if BITS_PER_LONG == 32
if (likely(divident <= 0xffffffffULL))
return (u32)divident / divisor;
do_div(divident, divisor); return divident;
#else
return divident / divisor; #endif
}
Which, if the divident is in 32-bit range, does a 32-bit division.
About math related rounding errors mentioned by Roman (not to be confused with clock granularity rounding), in our analysis and in our experience rounding errors of the math were never an issue in CFS, due to the extra buffering that nanosecs gives - i tweaked it a bit around CFSv10 but it was unprovable to have any effect. That's one of the advantages of working with nanoseconds: the fundamental time unit includes about 10 "low bits" that can carry over much of the error and reduce rounding artifacts. And even that math rounding errors we believe centers around 0.
In Roman's variant of CFS's algorithm the variables are 32-bit, but the error is rolled forward in separate fract_* (fractional) 32-bit variables, so we still have 32+32==64 bit of stuff to handle. So we think that in the end such a 32+32 scheme would be more complex (and anyone who took a look at fs2.c would i think agree - it took Peter a day to decypher the math!) - but we'll be happy to be surprised with patches of course :-)
Ingo
[*] the main advantage of microseconds would be that we could use "u32"
throughout to carry around the "now" variable (timestamp). That property of microseconds _is_ tempting and would reduce the task_struct footprint as well. But if we did that it would have ripple effects: we'd have to resort to (pretty complex and non-obvious) math to act against rounding errors. We'd either have to carry the rounding error with us in separate 32-bit variables (in essence creating 32+32 bit 64-bit variable), or we'd have to shift up the microseconds by say ... 10 binary positions ... in essence bringing us back into the same nanoseconds range. And then the wraparound problem of microseconds - 72 hours is not _that_ unrealistic to trigger intentionally, so we have to do _something_ about it to inhibit infinite starvation. We experimented around with all this and the overwhelming conclusion (so far) was that trying to reduce timestamps back to 32 bits is just not worth it. _Deltas_ should, can and _are_ 32-bit values already, even in the nanosecond model. So all the buffering and delta logic gives us most of the 32-bit advantages already, without the disadvantages of microseconds.
Re: CFS review
Hi,
Quoted 12 lines · Ingo Molnar
Most importantly, CFS _already_ includes a number of measures that act against too frequent math. So even though you can see 64-bit math code in it, it's only rarely called if your clock has a low resolution - and that happens all automatically! (see below the details of this buffered delta math)
I have not seen Roman notice and mention any of these important details (perhaps because he was concentrating on finding faults in CFS - which a reviewer should do), but those measures are still very important for a complete, balanced picture, especially if one focuses on overhead on small boxes where the clock is low-resolution.
Quoted 5 lines
As Peter has said it in his detailed review of Roman's suggested algorithm, our main focus is on keeping total complexity down - and we are (of course) fundamentally open to changing the math behind CFS, we ourselves tweaked it numerous times, it's not cast into stone in any way, shape or form.
You're comparing apples with oranges, I explicitely said:
"At this point I'm not that much interested in a few localized optimizations, what I'm interested in is how can this optimized at the design level"
IMO it's very important to keep computational and algorithmic complexity separately, I want to concentrate on the latter, so unless you can _prove_ that a similiar set of optimizations is impossible within my example, I'm going to ignore them for now. CFS has already gone through several versions of optimization and tuning, expecting the same from my design prototype is a little confusing...
I want to analyze the foundation CFS is based on, in the review I mentioned a number of other issues and design related questions. If you need more time, that's fine, but I'd appreciate more background information related to that and not that you only jump on the more trivial issues.
Quoted 6 lines
In Roman's variant of CFS's algorithm the variables are 32-bit, but the error is rolled forward in separate fract_* (fractional) 32-bit variables, so we still have 32+32==64 bit of stuff to handle. So we think that in the end such a 32+32 scheme would be more complex (and anyone who took a look at
fs2.cwould i think agree - it took Peter a day to decypher the math!)
Come on, Ingo, you can do better than that, I did mention in my review some of the requirements for the data types.
I'm amazed how you can get to that judgement so quickly, could you please substantiate that a little more?
I admit that the lack of source comments is an open invitation for further questions and Peter did exactly this and his comments were great - I'm hoping for more like that. You OTOH jump to conclusions based on a partial understanding what I'm actually trying to do.
Ingo, how about you provide some of the mathematical prove CFS is based on? Can you prove that the rounding errors are irrelevant? Can you prove that all the limit checks can have no adverse effect? I tried that and I'm not entirely convinced of that, but maybe it's just me, so I'd love to see someone else's attempt at this.
A major goal of my design is it to be able to define the limits within the scheduler is working correctly, so I know which information is relevant and what can be approximated.
bye, Roman
Re: CFS review
In reply to Linus TorvaldsHi Linus,
Quoted 7 lines · Linus Torvalds
And the "approximates" thing would be about the fact that we don't actually care about "absolute" microseconds as much as something
that is in the "roughly a microsecond" area. So if we say "it doesn't have to be microseconds, but it should be within a factor of two of a ms", we could avoid all the expensive divisions (even if they turn into multiplications with reciprocals), and just let people *shift* the CPU counter instead.
On that theme, expressing the subsecond part of high precision time in decimal instead of left-aligned binary always was an insane idea. Applications end up with silly numbers of multiplies and divides (likely as not incorrect) whereas they would often just need a simple shift as you say, if the tv struct had been defined sanely from the start. As a bonus, whenever precision gets bumped up, the new bits appear on the right in formerly zero locations on the right, meaning little if any code needs to change. What we have in the incumbent libc timeofday scheme is the moral equivalent of BCD.
Of course libc is unlikely ever to repent, but we can at least put off converting into the awkward decimal format until the last possible instant. In other words, I do not see why xtime is expressed as a tv instead of simple 32.32 fixed point. Perhaps somebody can elucidate me?
Regards,
Daniel
Re: CFS review
In reply to Linus TorvaldsHi,
Quoted 6 lines · Linus Torvalds
So I think it would be entirely appropriate to
- do something that *approximates* microseconds.
Using microseconds instead of nanoseconds would likely allow us to do 32-bit arithmetic in more areas, without any real overflow.
The basic problem is that one needs a number of bits (at least 16) for normalization, which limits the time range one can work with. This means that 32 bit leaves only room for 1 millisecond resolution, the remainder could maybe saved and reused later.
So AFAICT using micro- or nanosecond resolution doesn't make much computational difference.
bye, Roman
Re: CFS review
In reply to Roman ZippelQuoted 2 lines · Roman Zippel
while (1) sched_yield();
sched_yield() is being reworked at the moment. But in general we want apps to move away to sane locking constructs ASAP. There's some movement in the 3D space at least.
Ingo
Peter Zijlstra
maintainerRe: CFS review
In reply to Roman ZippelHi Roman,
Took me most of today trying to figure out WTH you did in fs2.c, more math and fundamental explanations would have been good. So please bear with me as I try to recap this thing. (No, your code was very much _not_ obvious, a few comments and broken out functions would have made a world of a difference)
So, for each task we keep normalised time
normalised time := time/weight
using Bresenham's algorithm we can do this prefectly (up until a renice
- where you'd get errors)
avg_frac += weight_inv
weight_inv = X / weight
avg = avg_frac / weight0_inv
weight0_inv = X / weight0
avg = avg_frac / (X / weight0)
= (X / weight) / (X / weight0)
= X / weight * weight0 / X
= weight0 / weight
So avg ends up being in units of [weight0/weight].
Then, in order to allow sleeping, we need to have a global clock to sync with. Its this global clock that gave me headaches to reconstruct.
We're looking for a time like this:
rq_time := sum(time)/sum(weight)
And you commented that the /sum(weight) part is where CFS obtained its accumulating rounding error? (I'm inclined to believe the error will statistically be 0, but I'll readily accept otherwise if you can show a practical 'exploit')
Its not obvious how to do this using modulo logic like Bresenham because that would involve using a gcm of all possible weights.
What you ended up with is quite interesting if correct.
sum_avg_frac += weight_inv_{i}however by virtue of the scheduler minimising:
avg_{i} - avg_{j} | i != j
this gets a factor of:
weight_{i}/sum_{j}^{N}(weight_{j})
( seems correct, needs more analysis though, this is very much a
statistical step based on the previous constraint. this might very well introduce some errors )
resulting in:
sum_avg_frac += sum_{i}^{N}(weight_inv_{i} *
weight_{i}/sum_{j}^{N}(weight_{j}))
weight_inv = X / weight
sum_avg = sum_avg_frac / sum(weight0_inv)
= sum_avg_frac / N*weight0_inv
weight0_inv = X / weight0
sum_avg = sum_avg_frac / N*weight0_inv
= sum_{i}^{N}(weight_inv_{i} *
weight_{i}/sum_{j}^{N}(weight_{j})) / N*weight0_inv
= sum_{i}^{N}(X/weight_{i} *
weight_{i}/sum_{j}^{N}(weight_{j})) / N*(X/weight0)
= N*X / sum_{j}(weight_{j}) * weight0/N*X
= weight0 / sum_{j}(weight_{j})Exactly the unit we were looking for [weight0/sum(weight)]
( the extra weight0 matching the one we had in the per task normalised
time )
I'm not sure all this is less complex than CFS, I'd be inclined to say it is more so.
Also, I think you have an accumulating error on wakeup where you sync with the global clock but fully discard the fraction.
Anyway, as said a more detailed explanation and certainly a proof of your math would be nice. Is this something along the lines of what you intended to convey?
If so, in the future please use more understandable language, we were taught math for a reason :-)
Regards,
Peter
Re: CFS review
Hi,
Quoted 5 lines · Peter Zijlstra
Took me most of today trying to figure out WTH you did in
fs2.c, more math and fundamental explanations would have been good. So please bear with me as I try to recap this thing. (No, your code was very much _not_ obvious, a few comments and broken out functions would have made a world of a difference)
Thanks for the effort though. :)
I know I'm not the best explaining these things, so I really appreciate the questions, so I know what to concentrate on.
Quoted 30 lines
So, for each task we keep normalised time
normalised time := time/weight
using Bresenham's algorithm we can do this prefectly (up until a renice
- where you'd get errors)
avg_frac+=weight_inv
weight_inv= X / weightavg =
avg_frac/weight0_inv
weight0_inv= X / weight0avg =
avg_frac/ (X / weight0)
= (X / weight) / (X / weight0)
= X / weight * weight0 / X
= weight0 / weightSo avg ends up being in units of [weight0/weight].
Then, in order to allow sleeping, we need to have a global clock to sync with. Its this global clock that gave me headaches to reconstruct.
We're looking for a time like this:
rq_time:= sum(time)/sum(weight)
Quoted 7 lines
And you commented that the /sum(weight) part is where CFS obtained its accumulating rounding error? (I'm inclined to believe the error will statistically be 0, but I'll readily accept otherwise if you can show a practical 'exploit')
Its not obvious how to do this using modulo logic like Bresenham because that would involve using a gcm of all possible weights.
I think I've sent you off into the wrong direction somehow. Sorry. :)
Let's ignore the average for a second, normalized time is maintained as:
normalized time := time * (2^16 / weight)
The important point is that I keep the value in full resolution of 2^-16 vsec units (vsec for virtual second or sec/weight, where every tasks gets weight seconds for every virtual second, to keep things simpler I also omit the nano prefix from the units for a moment). Compared to that CFS maintains a global normalized value in 1 vsec units.
Since I don't round the value down I avoid the accumulating error, this means that
time_norm += time_delta1 * (2^16 / weight) time_norm += time_delta2 * (2^16 / weight)
is the same as
time_norm += (time_delta1 + time_delta2) * (2^16 / weight)
CFS for example does this
delta_mine = calc_delta_mine(delta_exec, curr->load.weight, lw);
in above terms this means
time = time_delta * weight * (2^16 / weight_sum) / 2^16
The last shift now rounds the value down and if one does that 1000 times per second, the resolution of the value that is finally accounted to wait_runtime is also reduced appropriately.
The other rounding problem is based on that this term
x * prio_to_weight[i] * prio_to_wmult[i] / 2^32
doesn't produce x for most values in that tables (the same applies to the weight sum), so if we have chains, where the values are converted from one scale to the other, a rounding error is produced. In CFS this happens now because wait_runtime is maintained in nanoseconds and fair_clock is a normalized value.
The problem here isn't that these errors might have a statistical relevance, as they are usually completely overshadowed by measurement errors anyway. The problem is that these errors exist at all, this means they have to be compensated somehow, so that they don't accumulate over time and then become significant. This also has to be seen in the context of the overflow checks. All this adds a number of variables to the system which considerably increases complexity and makes a thorough analysis quite challenging.
So to get back to the average, if you look for this
rq_time := sum(time)/sum(weight)
you won't find it like this, this basically produces a weighted average and I agree this can't really be maintained via the modulo logic (at least AFAICT), so I'm using a simple average instead, so if we have:
time_norm = time/weight
we can write your rq_time like this:
weighted_avg = sum_{i}^{N}(time_norm_{i}*weight_{i})/sum_{i}^{N}(weight_{i})this is the formula for a weighted average, so we can aproximate the value using a simple average instead:
avg = sum_{i}^{N}(time_norm_{i})/NThis sum is now what I maintain at runtime incrementally:
time_{i} = sum_{j}^{S}(time_{j})
time_norm_{i} = time_{i}/weight_{i}
= sum_{j}^{S}(time_{j})/weight_{i}
= sum_{j}^{S}(time_{j}/weight_{i})If I add this up and add weigth0 I get:
avg*N*weigth0 = sum_{i}^{N}(time_norm_{i})*weight0and now I have also the needed modulo factors.
The average probably could be further simplified by using a different approximation. The question is how perfect this average has to be. The average is only used to control when a task gets its share, currently higher priority tasks are already given a bit more preference or a sleep bonus is added.
In CFS the average already isn't perfect due to above rounding problems, otherwise the sum of all updated wait_runtime should be 0 and if a task with a wait_runtime value different from 0 is added, fair_clock would have to change too to keep the balance.
So unless someone has a brilliant idea, I guess we have to settle for the approximation of a perfect scheduler. :) My approach is insofar different that I at least maintain an accurate fair share and approximate based on this the scheduling decision. This has IMO the advantage that the scheduler function can be easily exchanged, one can do it the quick and dirty way or one can put in the extra effort to get it closer to perfection. Either way every task will get its fair share.
The scheduling function I used is rather simple:
if (j >= 0 &&
((int)(task[l].time_norm - (task[j].time_norm + SLICE(j))) >= 0 ||
((int)(task[l].time_norm - task[j].time_norm) >= 0 &&
(int)(task[l].time_norm - (s + SLICE(l))) >= 0))) {So a new task is selected if there is a higher priority task or if the task has used up its share (unless the other task has lower priority and already got its share). It would be interesting to use a dynamic (per task) time slice here, which should make it possible to control the burstiness that has been mentioned.
Quoted 2 lines
I'm not sure all this is less complex than CFS, I'd be inclined to say it is more so.
The complexity is different, IMO the basic complexity to maintain the fair share is less and I can add arbitrary complexity to improve scheduling on top of it. Most of it comes now from maintaining the accurate average, it depends now on how the scheduling is finally done what other optimizations are possible.
Quoted 2 lines
Also, I think you have an accumulating error on wakeup where you sync with the global clock but fully discard the fraction.
I hope not, otherwise the checks at the end should have triggered. :) The per task requirement is
time_norm = time_avg * weight0 + avg_fract
I don't simply discard it, it's accounted to time_norm and then synced to the global average.
bye, Roman
Re: CFS review
In reply to Roman ZippelQuoted 3 lines · Roman Zippel
[...] With the increased text comes increased runtime memory usage, e.g.
task_structincreased so that only 5 of them instead 6 fit now into 8KB.
yeah, thanks for the reminder, this is on my todo list. As i suspect you noticed it too, much of the task_struct size increase is not fundamental and not related to 64-bit math at all - it's simply debug and instrumentation overhead.
Look at the following table (i386, nodebug):
size
----
pre-CFS 1328
CFS 1472
CFS+patch 1376 the very small patch below gets rid of 96 bytes. And that's only the beginning.
Ingo
-------------------------------------------------->
--- include/linux/sched.h | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-)
include/linux/sched.h +13 -8
@@ -905,23 +905,28 @@ struct sched_entity {struct rb_node run_node;unsigned int on_rq; +u64 exec_start; +u64 sum_exec_runtime;u64 wait_start_fair; +u64 sleep_start_fair; + +#ifdef CONFIG_SCHEDSTATS u64 wait_start; -u64 exec_start; +u64 wait_max; +s64 sum_wait_runtime; +u64 sleep_start; -u64 sleep_start_fair; -u64 block_start;u64 sleep_max; +s64 sum_sleep_runtime; + +u64 block_start;u64 block_max;u64 exec_max; -u64 wait_max; -u64 last_ran; -u64 sum_exec_runtime; -s64 sum_wait_runtime; -s64 sum_sleep_runtime;unsigned long wait_runtime_overruns;unsigned long wait_runtime_underruns; +#endif +#ifdef CONFIG_FAIR_GROUP_SCHED struct sched_entity *parent;/* rq on which this entity is (to be) queued: */
Re: x86 status was Re: -mm merge plans for 2.6.23
In reply to Andi KleenOn Wed, 11 Jul 2007 23:16:38 +0200, Andi Kleen said:
(Note - I'm just a usually-confused crash test dummy here...)
Quoted 4 lines
Well I spent a lot of time making the x86-64 timing code work well on a variety of machines; working around a wide variety of hardware and platform bugs. I obviously don't agree on your description of its maintenance state.
I'm seeing a bit of a disconnect here. If you spent all that time making it work, how come the guys who developed the patch are saying you didn't provide any feedback about the patchset?
Quoted 5 lines
Quoted 1 line
What contribution do we have from you instead? A week before the .23
I told him my objections privately earlier. Basically i would like to see an actually debuggable step-by-step change, not a rip everything out.
Odd, I looked at the patchset fairly closely a number of times, as I was hand-retrofitting the -rc[1-4] versions onto -rc[1-4]-mm kernels, and it looked to *me* like it was a nice set of 20 or so step-by-step changes (bisectable and everything - I got to do that once trying to figure out which one I botched). Was there something in there that I missed?
Re: x86 status was Re: -mm merge plans for 2.6.23
Quoted 11 lines · * [email protected] ([email protected]) wrote:
On Wed, 11 Jul 2007 23:16:38 +0200, Andi Kleen said:
(Note - I'm just a usually-confused crash test dummy here...)Quoted 4 lines
Well I spent a lot of time making the x86-64 timing code work well on a variety of machines; working around a wide variety of hardware and platform bugs. I obviously don't agree on your description of its maintenance state.
I'm seeing a bit of a disconnect here. If you spent all that time making it work, how come the guys who developed the patch are saying you didn't provide any feedback about the patchset?
I think Andi's referring to the existing x86_64 code, which gets replaced by the patchset in question.
Re: x86 status was Re: -mm merge plans for 2.6.23
Quoted 9 lines · Chris Wright
Quoted 8 lines · * [email protected] ([email protected]) wrote:
On Wed, 11 Jul 2007 23:16:38 +0200, Andi Kleen said:
(Note - I'm just a usually-confused crash test dummy here...)Quoted 4 lines
Well I spent a lot of time making the x86-64 timing code work well on a variety of machines; working around a wide variety of hardware and platform bugs. I obviously don't agree on your description of its maintenance state.
Quoted 6 lines
Quoted 3 lines
I'm seeing a bit of a disconnect here. If you spent all that time making it work, how come the guys who developed the patch are saying you didn't provide any feedback about the patchset?
I think Andi's referring to the existing
x86_64code, which gets replaced by the patchset in question.
<Takes a closer look at the patches> D'Oh! :) Yeah, the -rc4 version I'm looking at is like a dozen 1-3K patches setting up and cleaning up, and then one monster 65K patch doing the clockevents conversion, then another 6 or 8 small ones.
Yeah, that one big patch really doesn't look separable to me. But as I said, I'm just a crash test dummy here. :)
Andrew - how do you feel about keeping this in the -mm tree until Linus, Andi, Ingo, and Thomas get on the same page (which may be around the 2.6.24 merge window, by my guesstimate)?
Re: x86 status was Re: -mm merge plans for 2.6.23
Quoted 3 lines · * [email protected] ([email protected]) wrote:
Andrew - how do you feel about keeping this in the -mm tree until Linus, Andi, Ingo, and Thomas get on the same page (which may be around the 2.6.24 merge window, by my guesstimate)?
Well, that's supposed to be Andi's tree and aggregated by Andrew into -mm. But keeping it in -mm isn't the hard part. It's getting enough testing to convince Linus it's safe, since there's no simple way to enable clockevents in a slow manner. IOW, keeping it in -mm just postpones the issue.
Re: x86 status was Re: -mm merge plans for 2.6.23
In reply to [email protected]Quoted 7 lines · On Wed, 11 Jul 2007, [email protected] wrote:
<Takes a closer look at the patches> D'Oh! :) Yeah, the -rc4 version I'm looking at is like a dozen 1-3K patches setting up and cleaning up, and then one monster 65K patch doing the clockevents conversion, then another 6 or 8 small ones.
Yeah, that one big patch really doesn't look separable to me.
I think it should be.
That big patch really does do a *lot* more than just the "clockevents conversion". It does all the hpet clock setup changes etc that are about the hardware, and have *nothing* to do with actually changing the interfaces.
For example, look at the hpet.c part of that patch. Totally independent cleanups of everything else.
Or look at the changes to __setup_APIC_LVTT(). Same thing.
All the actual hardware interface changes are *totally* independent of the software interface changes, and a lot of them are just cleanups.
But those hardware interface changes are easily the things that can break, where some cleanup results in register writes being done in a different order or something, and so if there's a bug there (and it's not visible on most setups), now you cannot tell where the bug is.
Another example: setup_APIC_timer() used to wait for a timer interrupt trigger to happen on the i8259 timer (or HPET). That code just got removed (or maybe it got moved so subtly that I just don't see it).
What has that got to do with switching from the old timer interface to the new one?
NOTHING.
So those kinds of changes that change hardware access functions should have been done separately. Maybe there's a machine where that early synchronization was necessary for some subtle timing reason. If so, removing it sounds like a bug, no? Wouldn't it have been nice to see that removal as a separate patch that was independent of the interface switch- over?
I'd be a *lot* happier with switching over interfaces if I thought that the low-level hardware drivers didn't change at the same time. But they *do* change, afaik.
Linus
Re: x86 status was Re: -mm merge plans for 2.6.23
In reply to [email protected]Quoted 6 lines · On Wed, 11 Jul 2007, [email protected] wrote:
Odd, I looked at the patchset fairly closely a number of times, as I was hand-retrofitting the -rc[1-4] versions onto -rc[1-4]-mm kernels, and it looked to *me* like it was a nice set of 20 or so step-by-step changes (bisectable and everything - I got to do that once trying to figure out which one I botched). Was there something in there that I missed?
The patch-set itself actually looks fine, as far as I'm concerned.
But it does seem to have that "enable everything in one go" problem.
I'd much rather see one time source at a time being converted, and enabled then and there, so that when people report problems and do a bisection, if it was HPET that broke, you get the commit that changed HPET.
As it is, looking at that set, it *looks* like you'd get the "ok, now enable it all" as the commit that breaks, which tells you hardly anything, since the commit that _shows_ the behaviour has absolutely nothing to do with the code that actually causes it.
But yeah, the patch series per se doesn't look bad. If it wasn't for me being burnt by the last big switch-over for timers, I probably wouldn't mind it at all, personally.
Linus
Re: x86 status was Re: -mm merge plans for 2.6.23
In reply to Ingo MolnarQuoted 3 lines · Ingo Molnar
What you just did here is a slap in the face to a lot of contributors who worked hard on this code :(
Ingo, I'm sorry to say so, but your answer just convinced me that you're wrong, and we MUST NOT take that code.
That was *exactly* the same thing you talked about when I refused to take the original timer changes into 2.6.20. You were talking about how lots of people had worked really hard, and how it was really tested.
And it damn well was NOT really tested, and 2.6.21 ended up being a horribly painful experience (one of the more painful kernel releases in recent times), and we ended up havign to fix a *lot* of stuff.
And you admitted you were wrong at the time.
Now you do the *exact* same thing.
Here's a big clue: it doesn't matter one _whit_ how much face-slapping you get, or how much effort some programmers have put into the code. It's untested. And no, we are *not* going to do another "rip everything out, and replace it with new code" again.
Over my dead body.
We're going to do this thing gradually, or not at all.
And if somebody feels slighted by the face-slap, and thinks he has already done enough, and isn't interested in doing it gradually, then good riddance. The "not at all" seems like a good idea, and maybe we can re-visit this in a year or two.
I'm not going to have another 2.6.21 on my hands.
Linus
Re: x86 status was Re: -mm merge plans for 2.6.23
Linus,
Quoted 8 lines · Linus Torvalds
Here's a big clue: it doesn't matter one _whit_ how much face-slapping you get, or how much effort some programmers have put into the code. It's untested. And no, we are *not* going to do another "rip everything out, and replace it with new code" again.
Over my dead body.
We're going to do this thing gradually, or not at all.
Can you please shed some light on me, how exactly you switch an architecture gradually to clock events.
You simply can not convert PIT today and the HPET next week followed by the local APIC in three month.
At least not to my knowledge.
Quoted 4 lines
And if somebody feels slighted by the face-slap, and thinks he has already done enough, and isn't interested in doing it gradually, then good riddance. The "not at all" seems like a good idea, and maybe we can re-visit this in a year or two.
I have no problem to brew this for some more time. I got not repulsed by the 2.6.20 decision, but I have no clue how to communicate with a black hole.
tglx
Re: x86 status was Re: -mm merge plans for 2.6.23
Quoted 3 lines · Thomas Gleixner
Can you please shed some light on me, how exactly you switch an architecture gradually to clock events.
For example, we can make sure that the code in question that actually touches the hardware stays exactly the same, and then just move the interfaces around - and basically guarantee that _zero_ hardware-specific issues pop up when you switch over, for example.
That way there is a gradual change-over.
The other approach (which would be nice _too_) is to actually try to convert one clock source at a time. Why is that not an option?
Linus
Re: x86 status was Re: -mm merge plans for 2.6.23
Linus,
Quoted 6 lines · Linus Torvalds
For example, we can make sure that the code in question that actually touches the hardware stays exactly the same, and then just move the interfaces around - and basically guarantee that _zero_ hardware-specific issues pop up when you switch over, for example.
That way there is a gradual change-over.
Ok, I can try to split this down further.
Quoted 2 lines
The other approach (which would be nice _too_) is to actually try to convert one clock source at a time. Why is that not an option?
We need to give control to the clock events core code once we convert one clock event device. Having two competing subsystems controlling different devices (e.g. PIT and APIC) is not really desirable.
The HPET change, which is the larger part of the conversion set simply because we now share the code with i386, might be split out by disabling HPET in the first step, doing the PIT / APIC conversion and then the HPET one in a separate step.
Thanks,
tglx
Re: x86 status was Re: -mm merge plans for 2.6.23
Quoted 4 lines · * Thomas Gleixner ([email protected]) wrote:
The HPET change, which is the larger part of the conversion set simply because we now share the code with i386, might be split out by disabling HPET in the first step, doing the PIT / APIC conversion and then the HPET one in a separate step.
The timer specific changes (i.e. the merges between arches) can be done more slowly, but the setup above is basically where I started, and it was already broken on one of my test boxes. Anyway, I'll help you however I can, because it's important to me to get this merged.
thanks,
-chris
Re: x86 status was Re: -mm merge plans for 2.6.23
In reply to Thomas GleixnerQuoted 5 lines · Thomas Gleixner
The HPET change, which is the larger part of the conversion set simply because we now share the code with i386, might be split out by disabling HPET in the first step, doing the PIT / APIC conversion and then the HPET one in a separate step.
But that misses the point. It means that the commit that actually *changes* the code never actually gets tested on its own
Why not just fix up the HPET code so that it can be shared *first*. Without the other conversion? Really - What's so wrong with the hpet.c changes in the *absense* of conversion to clockevents? Those changes seem to be totally independent - just abstracting ou tthe "hpet_get_virt_address()" stuff etc.
None of that has anything to do with clockevents, as far as I can see.
In other words, you now change a i386-only file, and maybe it breaks subtly on i386 as a result. Wouldn't it be nicer to see that breakage as a separate event?
Then, the x86-64 clockevents code will switch over entirely, but now it switches over to something we can say has gotten testing, and we know the switch-over won't break any 32-bit code, because the switch-over literally didn't change anything at all for that case.
See? THAT is what I mean by "gradual". Bugs happen, but if we can make _independent_ bugs show up in _independent_ commits, that will make it much easier to figure out what happened.
The same is true of a lot of the APIC timer code. Sure, that patch has the actual conversion in it, and you don't have the cross-architecture issues, but more than 50% of the patch seems to be just cleanup that is independent of the actual switch-over, no?
Again, if it was done as a "one patch for cleanup, and another patch that actually switches the higher-level interfaces around", then the two mostly independent issues (of "hardware access/initialization" vs "higher-level changes in how it got called") get done as two independent commits.
And no, I really probably wouldn't ask for this, but 2.6.21 showed *exactly* this problem. Trivial debugging helps like "git bisect" didn't help at all, because all the problems started when the new code was "activated", not when it was actually brought in.
Linus
Re: x86 status was Re: -mm merge plans for 2.6.23
Linus,
Quoted 11 lines · Linus Torvalds
Why not just fix up the HPET code so that it can be shared *first*. Without the other conversion? Really - What's so wrong with the
hpet.cchanges in the *absense* of conversion to clockevents? Those changes seem to be totally independent - just abstracting ou tthe "hpet_get_virt_address()" stuff etc.None of that has anything to do with clockevents, as far as I can see.
In other words, you now change a i386-only file, and maybe it breaks subtly on i386 as a result. Wouldn't it be nicer to see that breakage as a separate event?
Sure, I meant to do the HPET changes to i386 separate as a preparatory patch.
Sharing HPET before the conversion is nasty at best (it involves a ton of ifdeffery at least).
Quoted 4 lines
Then, the x86-64 clockevents code will switch over entirely, but now it switches over to something we can say has gotten testing, and we know the switch-over won't break any 32-bit code, because the switch-over literally didn't change anything at all for that case.
Well, we know that it works on i386, but once we turn on the x64 switch we have not tested the shared code for x64 yet.
I try to find some practicable compromise between the big bang patch and the theoretical gradual optimum.
Quoted 4 lines
The same is true of a lot of the APIC timer code. Sure, that patch has the actual conversion in it, and you don't have the cross-architecture issues, but more than 50% of the patch seems to be just cleanup that is independent of the actual switch-over, no?
I said before, that I'm going to split them further.
tglx
Re: x86 status was Re: -mm merge plans for 2.6.23
In reply to Linus TorvaldsQuoted 4 lines
The same is true of a lot of the APIC timer code. Sure, that patch has the actual conversion in it, and you don't have the cross-architecture issues, but more than 50% of the patch seems to be just cleanup that is independent of the actual switch-over, no?
I don't think it's that much cleanup. One of my goals for x86-64 was always to have it support modern x86 only; this means in particularly most of the old bug workaround removed. With the APIC timer merging a lot of that crap gets back in.
I would prefer to keep APIC code separate.
-Andi
Re: x86 status was Re: -mm merge plans for 2.6.23
Andi,
Quoted 11 lines · Andi Kleen
Quoted 4 lines
The same is true of a lot of the APIC timer code. Sure, that patch has the actual conversion in it, and you don't have the cross-architecture issues, but more than 50% of the patch seems to be just cleanup that is independent of the actual switch-over, no?
I don't think it's that much cleanup. One of my goals for x86-64 was always to have it support modern x86 only; this means in particularly most of the old bug workaround removed. With the APIC timer merging a lot of that crap gets back in.
I would prefer to keep APIC code separate.
Care to look at the patch ? It _IS_ seperate.
Only HPET and PIT got shared.
tglx
Re: x86 status was Re: -mm merge plans for 2.6.23
In reply to Andi KleenQuoted 9 lines · Andi Kleen
Quoted 4 lines
The same is true of a lot of the APIC timer code. Sure, that patch has the actual conversion in it, and you don't have the cross-architecture issues, but more than 50% of the patch seems to be just cleanup that is independent of the actual switch-over, no?
I don't think it's that much cleanup. One of my goals for x86-64 was always to have it support modern x86 only; this means in particularly most of the old bug workaround removed. With the APIC timer merging a lot of that crap gets back in.
i dont think "clean, modern x86 code" will ever happen - x86_64 has and is going to have the exact same type of crap. And i'll say a weird thing
now: that is a _blessing_. Why? Because this crap in question originates from the _diversity_ of the platform, and that is a much larger asset than the cost of the quirks can ever be!
What you suggest does not end up in "clean 64-bit code", it ends up in "a bit less crappy 64-bit code", plus a lot of unnecessary duplication of effort and duplication of code - which easily introduces more crap total than it gets rid of ...
The x86 architecture isnt fully analogous to a random piece of device hardware that evolves. It is more of a collector of random pieces of hardware that evolve independently, and as such it will always be exposed to human messups in a factorized way. "The pristine, clean architecture" is an utopia and it will never come until humans design hardware.
Under your scheme we'll end up with is two sets of code which share some of the workarounds and dont share some others. No, in fact we _already_ ended up with two sets of code that is crappy in different ways. We had countless cases of bugs fixed in i386 but not fixed in x86_64. (and vice versa) Sharing code for similar hardware is almost always good.
I think the PowerPC experience (although it is not a fully equivalent case) about them merging their 32-bit and 64-bit architectures was an overwhelmingly positive move, and x86 could learn a thing or two from that.
The only way to fight crappy hardware is to map it, to understand it and to design as cleanly in the presence of it as possible. Having two sets of code for the same thing hardly serves that purpose. In fact, having _more_ crappy hardware _forces_ us to do a cleaner design (up to a pain threshold).
Ingo
Re: x86 status was Re: -mm merge plans for 2.6.23
Quoted 2 lines
i dont think "clean, modern x86 code" will ever happen -
x86_64has and is going to have the exact same type of crap. And i'll say a weird thing
Yes, but it will be new crap, but no old crap anymore.
If you always pile the new crap on the old crap at some point the whole thing might fall over. 64bit was intended as a fresh start.
Admittedly we're getting more and more workarounds too and sometimes when I want to remove cruft i find out it is still needed on some 64bit boxes (e.g. see my repeated attempts to clean up the irq 0 routing), but it's still much better than i386.
Quoted 4 lines
I think the PowerPC experience (although it is not a fully equivalent case) about them merging their 32-bit and 64-bit architectures was an overwhelmingly positive move, and x86 could learn a thing or two from that.
The equivalent to the powerpc way would be essentially to report i386 into the x86-64 code base and leave the really old hardware only in arch/i386. I've considered doing it, but it would be an awful lot of work and to tempt distributions to actually use the new port would require going back quite a long time. And at least immediately it would end up with three cases to do things instead of two like currently.
-Andi
Re: x86 status was Re: -mm merge plans for 2.6.23
Quoted 7 lines · * Andi Kleen ([email protected]) wrote:
The equivalent to the powerpc way would be essentially to report i386 into the x86-64 code base and leave the really old hardware only in
arch/i386. I've considered doing it, but it would be an awful lot of work and to tempt distributions to actually use the new port would require going back quite a long time. And at least immediately it would end up with three cases to do things instead of two like currently.
Well that's just silly. The right way will never create 3 ways, but always keep the limit to the existing 2 where the differences aren't worth reconciling, and 1 for anything that is common.
It will be a fair amount of work, so any constructive input you have upfront would be helpful.
thanks,
-chris
Re: x86 status was Re: -mm merge plans for 2.6.23
In reply to Andi KleenQuoted 8 lines · Andi Kleen
Quoted 3 lines
i dont think "clean, modern x86 code" will ever happen -
x86_64has and is going to have the exact same type of crap. And i'll say a weird thingYes, but it will be new crap, but no old crap anymore.
If you always pile the new crap on the old crap at some point the whole thing might fall over. 64bit was intended as a fresh start.
I think there's no such thing as a fresh start for a diverse architecture - the ia64 failure has proven that. x86_64 CPUs still do A20 emulation today (!). We still have people running industrial boards on real i386 DX CPUs, with the latest upstream kernel. 15 years ago an i386 DX was already quite obsolete. 32-bit is not going to go away in our lifetime, and we'll want to support it in a first-grade way. We better realize that prospect and have it right before our eyes in a single tree wherever it makes sense to share code - i'm certainly not talking about sharing mtrr/centaur.c or k8.c. (and i'm not necessarily suggesting to share io_apic.c either - although it's certainly borderline.)
Ingo
Re: x86 status was Re: -mm merge plans for 2.6.23
Quoted 4 lines · Ingo Molnar
Quoted 4 lines
Quoted 3 lines
i dont think "clean, modern x86 code" will ever happen -
x86_64has and is going to have the exact same type of crap. And i'll say a weird thing
Quoted 8 lines
Quoted 4 lines
Yes, but it will be new crap, but no old crap anymore.
If you always pile the new crap on the old crap at some point the whole thing might fall over. 64bit was intended as a fresh start.
I think there's no such thing as a fresh start for a diverse architecture - the ia64 failure has proven that.
x86_64CPUs still do A20 emulation today (!).
x86-64 doesn't care about a lot of x86 baggage and a lot of things have been even obsoleted in the platform.
In practice the backwards compatibility on x86 isn't that great either. For example a significant number of new systems don't even work correctly in PIC mode anymore.
Quoted 2 lines
We still have people running industrial boards
on real i386 DX CPUs, with the latest upstream kernel. 15 years ago an
Yes, but those for example would be perfectly happy with an arch/i386 with all APIC and SMP code stripped out.
Only the few people who still run dual P5s might not, but those could continue using old kernels.
But eventually I think that would be the right clean way:
arch/i386 stripped down port for truly old systems like the embedded 386 upto 586 or early 686. No SMP or APIC.arch/x86 supporting 32bit and 64bit for reasonably modern systems. NUMAQ/Voyager/P5-SMP/visual workstation gone [frankly the user base of those is too small to justify the code impact]
It's just quite ugly to get there and when you think through it the actual advantages of such a setup it is likely not enough to justify the significant work to make it work.
Also I wouldn't have any idea how to regression test significant changes to arch/i386 aimed at old systems. e.g. I don't think the powerpc people actually tried to still support really old systems where it is hard to do regression tests anymore, only really supported platforms.
So while such a setup would be quite nice the practical problems of getting there are nasty. Also I must admit I prefer hacking on new code instead.
-Andi
Re: x86 status was Re: -mm merge plans for 2.6.23
In reply to Thomas GleixnerQuoted 10 lines · Thomas Gleixner
Linus,
Quoted 6 lines · Linus Torvalds
For example, we can make sure that the code in question that actually touches the hardware stays exactly the same, and then just move the interfaces around - and basically guarantee that _zero_ hardware-specific issues pop up when you switch over, for example.
That way there is a gradual change-over.
Quoted 8 lines
Ok, I can try to split this down further.
Quoted 2 lines
The other approach (which would be nice _too_) is to actually try to convert one clock source at a time. Why is that not an option?
We need to give control to the clock events core code once we convert one clock event device. Having two competing subsystems controlling different devices (e.g. PIT and APIC) is not really desirable.
Can't you take the entire legacy clock system and wrap it as a single legacy clock source? Then you take bits out of the old system and put them as independent sources in the new system? When the legacy clock system is empty, you remove the legacy clock source.
Signature · 1 line
Mathematics is the supreme nostalgia of our time.
Re: x86 status was Re: -mm merge plans for 2.6.23
In reply to Linus TorvaldsQuoted 4 lines · * Linus Torvalds ([email protected]) wrote:
For example, we can make sure that the code in question that actually touches the hardware stays exactly the same, and then just move the interfaces around - and basically guarantee that _zero_ hardware-specific issues pop up when you switch over, for example.
That's not quite right. Leaving the code unchanged caused breakage already. The PIT is damn stupid and can be sensitive to how quickly it's programmed. So code that enable/disable didn't change, but frequency with which it is called did and broke some random boxes.
Quoted 2 lines
The other approach (which would be nice _too_) is to actually try to convert one clock source at a time. Why is that not an option?
It was that way for x86_64, that's the first thing I fixed (since it was done by fully disabling all other timers but the one coverted ;-)
Re: x86 status was Re: -mm merge plans for 2.6.23
Quoted 5 lines · Chris Wright
That's not quite right. Leaving the code unchanged caused breakage already. The PIT is damn stupid and can be sensitive to how quickly it's programmed. So code that enable/disable didn't change, but frequency with which it is called did and broke some random boxes.
Sure. We cannot avoid *all* problems. Bugs happen.
But at least we could try to make sure that there aren't totally unnecessary changes in that switch-over patch. Which there definitely were, as far as I can tell.
Linus
Re: x86 status was Re: -mm merge plans for 2.6.23
Quoted 8 lines · Linus Torvalds
Quoted 5 lines · Chris Wright
That's not quite right. Leaving the code unchanged caused breakage already. The PIT is damn stupid and can be sensitive to how quickly it's programmed. So code that enable/disable didn't change, but frequency with which it is called did and broke some random boxes.
Quoted 5 lines
Sure. We cannot avoid *all* problems. Bugs happen.
But at least we could try to make sure that there aren't totally unnecessary changes in that switch-over patch. Which there definitely were, as far as I can tell.
one note is that the "talk differently to hardware" thing is in part already tested with the 32 bit tickless code; a lot of people (80% ?) are still using the 32 bit OS on their 64 bit machines, and the 32 bit code already talks in the "new way" to this hardware.... (and since Fedora 7 already ships tickless for 32 bit there are quite a lot of people using that in practice, in addition to the kernel.org kernel users)
I would expect just about all the hardware interaction issues to have popped up already because of this "run 32 bit on 64 bit hardware" thing.
Signature · 2 lines
if you want to mail me at work (you don't), use arjan (at) linux.intel.com Test the interaction between Linux and your BIOS via http://www.linuxfirmwarekit.org
Re: x86 status was Re: -mm merge plans for 2.6.23
In reply to Linus TorvaldsQuoted 4 lines · Linus Torvalds
That was *exactly* the same thing you talked about when I refused to take the original timer changes into 2.6.20. You were talking about how lots of people had worked really hard, and how it was really tested.
yes - i was (way too!) upset about it, and your reasoning for the rejection was hard (on us) but fair: you wanted a quiet 2.6.20, and you felt fundamentally uneasy about the patches.
Quoted 3 lines
And it damn well was NOT really tested, and 2.6.21 ended up being a horribly painful experience (one of the more painful kernel releases in recent times), and we ended up havign to fix a *lot* of stuff.
yes. We had 12 -hrt/dynticks merge related regressions between 2.6.21-rc1 and -final, and 4 after final. Here's a quick post-mortem:
12 fixes after -rc1:
[PATCH] i386: Fix bogus return value in hpet_next_event()
[PATCH] clockevents: remove bad designed sysfs support for now [PATCH] clocksource: Fix thinko in watchdog selection
[PATCH] dynticks: fix hrtimer rounding error in next_timer_interrupt [PATCH] i386: add command line option "local_apic_timer_c2_ok" [PATCH] i386: disable local apic timer via command line or dmi quirk [PATCH] i386: clockevents fix breakage on Geode/Cyrix PIT
[PATCH] i386: trust the PM-Timer calibration of the local APIC timer [PATCH] clockevents: Fix suspend/resume to disk hangs
[PATCH] highres: do not run the TIMER_SOFTIRQ after switching to highres mode [PATCH] hrtimer: prevent overrun DoS in hrtimer_forward()
[PATCH] Save/restore periodic tick information over suspend/resume implementations
4 fixes after -final:
2.6.21.1: -
2.6.21.2:
[PATCH] clocksource: fix resume logic
2.6.21.3: -
2.6.21.4: -
2.6.21.5:
[PATCH] NOHZ: Rate limit the local softirq pending warning output [PATCH] Ignore bogus ACPI info for offline CPUs [PATCH] i386: HPET, check if the counter works
2.6.21.6: -
it's all pretty quiet today on the dynticks regressions front. (there are no open regressions in either the upstream i386 code or in the devel patches we are aware of. Forced-HPET in -mm, which is not part of this queue in question [but which is done for dynticks], has one open regression.)
The majority of the above bugs were in the infrastructure code. (the worst was the generic resume/suspend one fixed in 2.6.21.2) And sadly, a fair number of the infrastructure bugs we introduced during the frentic clockevents/dynticks rewrites/redesigns we did between .20 and .21. That was a royally stupid mistake for us to do - instead of patiently waiting for the bugs to be shaken out we destabilized the infrastructure. (it was a "lets make this thing so nice that it's impossible to reject" instintic gut reaction.)
In the 'weird arch bugs' category, out of the 6 i386 breakages listed above, 'i386 legacy systems' was/is by far the worst offender: 4-5 were on such old (not 64-bit-capable) systems. (this is not really a surprise) While x86_64 certainly has weird crap hardware too, it probably is an order of magnitude fewer than i386 - just due to the sheer volume, time and diversity difference. (On the other hand if there's crap then it will be debugged/tested slower than on 32-bit, which offsets that advantage.)
The most prominent bugs were the ones that were in the infrastructure - they affected many machines. (But i'd expect the infrastructure to be pretty robust by now.)
The x86_64 hrt/dynticks code makes the x86_64 PIT driver (and hpet too) shared between the two architectures - which is perhaps another difference to the original i386 clockevents merge.
We also integrated _all_ feedback we got, and we had the capacity and capability to fix whatever other feedback comes back - it just never came ... until today.
But i fully agree with you that the cleanups should be done separately - it's just so hard to actually hack on the old hpet code (and to understand it to begin with) without first cleaning it up a bit so that it does not cause permanent brain damage ;)
Ingo
Re: x86 status was Re: -mm merge plans for 2.6.23
Quoted 4 lines · Ingo Molnar
We also integrated _all_ feedback we got, and we had the capacity and capability to fix whatever other feedback comes back - it just never came ... until today.
One thing I'll happily talk about is that while 2.6.21 was painful, you and Thomas in particular were both very responsible about the thing, so no, I'm not at all complaining or worried about it in that sense!
I just really _really_ wish we could have two fairly stable releases in a row. I think 2.6.22 has the potential to be a pretty good setup, and I'd really like to avoid having another 2.6.21 immediately afterwards.
So I'm not worried about integration and getting fixes when things break per se, but I *am* worried that this is an area where we've traditionally had lots of unexpected problems.
And hey, maybe this time there will be none. I just still smart from the last time, so I'd prefer it to go more smoothly this time around.
Linus
Re: x86 status was Re: -mm merge plans for 2.6.23
In reply to Andi KleenQuoted 7 lines · Andi Kleen
More review:
Quoted 4 lines
xen-fix-x86-config-dependencies.patch xen-suppress-abs-symbol-warnings-for-unused-reloc-pointers.patch xen-cant-support-numa-yet.patch
The first and third of these are just simple Kconfig updates, and the middle one just updates the list of symbols which shouldn't be warned about in CONFIG_RELOCATABLE's absolute symbol check. They're completely harmless but may prevent someone from generating an unbuildable .config.
Quoted 2 lines
Quoted 2 lines
x86-fix-iounmaps-use-of-vm_structs-size-field.patch
This appears to fix a real bug; the only question is whether x86-64 needs the same treatment. I'm not sure if the original bug reporter (dave young) has confirmed it fixed his problem.
J
Re: x86 status was Re: -mm merge plans for 2.6.23
In reply to Andi KleenQuoted 9 lines · Andi Kleen
These all need re-review:
Quoted 7 lines
i386-add-support-for-picopower-irq-router.patch make-arch-i386-kernel-setupcremapped_pgdat_init-static.patch arch-i386-kernel-i8253c-should-include-asm-timerh.patch make-arch-i386-kernel-io_apicctimer_irq_works-static-again.patch
quicklist-support-for-x86_64.patch
^^^ That patch was supposed to be merged for 2.6.22 (you told me you forgot to merge it) and has been for a long time in mm. Does it now need to be rereviewed for 2.6.23? The other pieces of the quicklist patch for core and other arches were merged for 2.6.22.
Re: x86 status was Re: -mm merge plans for 2.6.23
Quoted 10 lines · Christoph Lameter
Quoted 6 lines · Andi Kleen
These all need re-review:
Quoted 4 lines
i386-add-support-for-picopower-irq-router.patch make-arch-i386-kernel-setupcremapped_pgdat_init-static.patch arch-i386-kernel-i8253c-should-include-asm-timerh.patch make-arch-i386-kernel-io_apicctimer_irq_works-static-again.patch
Quoted 6 lines
Quoted 1 line
Quoted 1 line
quicklist-support-for-x86_64.patch
^^^ That patch was supposed to be merged for 2.6.22 (you told me you forgot to merge it) and has been for a long time in mm. Does it now need to be rereviewed for 2.6.23? The other pieces of the quicklist patch for core and other arches were merged for 2.6.22.
It's just on the normal re-review list. But it'll likely go in.
-Andi
Quoted 7 lines
mutex_unlock-later-in-seq_lseek.patch
zs-move-to-the-serial-subsystem.patch
fs-block_devc-use-list_for_each_entry.patchintroduce-o_cloexec-take-2.patch
o_cloexec-for-scm_rights.patch
Umm, Andrew - mixing new userspace interface, compltely rewritten drivers and simple fixes in a simple misc category doesn't exactly help reading this list :)
fallocate, Re: -mm merge plans for 2.6.23
In reply to Andrew MortonQuoted 6 lines
fallocate-implementation-on-i86-x86_64-and-powerpc.patch fallocate-on-s390.patch
fallocate-on-ia64.patch fallocate-on-ia64-fix.patchMerge.
Hopefull this will be done during the 2.6.23 merge window, but right now it's not (yet).
lguest, Re: -mm merge plans for 2.6.23
In reply to Andrew MortonQuoted 1 line
lguest-export-symbols-for-lguest-as-a-module.patch
__put_task_struct is one of those no way in hell should this be exported things because we don't want modules messing with task lifetimes.
Fortunately I can't find anything actually using this in lguest, so it looks the issue has been solved in the meantime.
I also have a rather bad feeling about exporting access_process_vm. This is the proverbial sledge hammer for access to user vm addresses and I'd rather keep it away from module programmers with "if all you have is a hammer ..." in mind.
In lguest this is used by send_dma which from my short reading of the code seems to be the central IPC mechanism. The double copy here doesn't look very efficient to me either. Maybe some VM folks could look into a better way to archive this that might be both more efficient and not require the export.
Quoted 9 lines
lguest-the-guest-code.patch
lguest-the-host-code.patch lguest-the-host-code-lguest-vs-clockevents-fix-resume-logic.patch lguest-the-asm-offsets.patch lguest-the-makefile-and-kconfig.patch lguest-the-console-driver.patch lguest-the-net-driver.patch lguest-the-block-driver.patch lguest-the-documentation-example-launcher.patch
Just started to reading this (again) so no useful comment here, but it would be nice if the code could follow CodingStyle and place the || and && at the end of the line in multiline conditionals instead of at the beginning of the new one.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Re: lguest, Re: -mm merge plans for 2.6.23
On Wed, 11 Jul 2007 14:23:24 +0200 Christoph Hellwig wrote:
...
Quoted 10 lines
Quoted 9 lines
lguest-the-guest-code.patch
lguest-the-host-code.patch lguest-the-host-code-lguest-vs-clockevents-fix-resume-logic.patch lguest-the-asm-offsets.patch lguest-the-makefile-and-kconfig.patch lguest-the-console-driver.patch lguest-the-net-driver.patch lguest-the-block-driver.patch lguest-the-documentation-example-launcher.patch
Quoted 4 lines
Just started to reading this (again) so no useful comment here, but it would be nice if the code could follow CodingStyle and place the || and && at the end of the line in multiline conditionals instead of at the beginning of the new one.
I prefer them at the ends of lines also, but that's not in CodingStyle, it's just how we do it most of the time (so "coding style", without caps).
---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Andrew Morton
maintainerRe: lguest, Re: -mm merge plans for 2.6.23
In reply to Christoph HellwigQuoted 8 lines · On Wed, 11 Jul 2007 14:23:24 +0200 Christoph Hellwig <[email protected]> wrote:
Quoted 1 line
lguest-export-symbols-for-lguest-as-a-module.patch
__put_task_structis one of those no way in hell should this be exported things because we don't want modules messing with task lifetimes.Fortunately I can't find anything actually using this in lguest, so it looks the issue has been solved in the meantime.
Ther are a couple of calls to put_task_struct() in there, and that needs __put_task_struct() exported.
Quoted 5 lines
I also have a rather bad feeling about exporting
access_process_vm. This is the proverbial sledge hammer for access to user vm addresses and I'd rather keep it away from module programmers with "if all you have is a hammer ..." in mind.
hm, well, access_process_vm() is a convenience wrapper around get_user_pages(), whcih is exported.
Quoted 17 lines
In lguest this is used by
send_dmawhich from my short reading of the code seems to be the central IPC mechanism. The double copy here doesn't look very efficient to me either. Maybe some VM folks could look into a better way to archive this that might be both more efficient and not require the export.Quoted 9 lines
lguest-the-guest-code.patch
lguest-the-host-code.patch lguest-the-host-code-lguest-vs-clockevents-fix-resume-logic.patch lguest-the-asm-offsets.patch lguest-the-makefile-and-kconfig.patch lguest-the-console-driver.patch lguest-the-net-driver.patch lguest-the-block-driver.patch lguest-the-documentation-example-launcher.patch
Quoted 4 lines
Just started to reading this (again) so no useful comment here, but it would be nice if the code could follow CodingStyle and place the || and && at the end of the line in multiline conditionals instead of at the beginning of the new one.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Re: lguest, Re: -mm merge plans for 2.6.23
In reply to Christoph HellwigQuoted 7 lines · Christoph Hellwig
Quoted 1 line
lguest-export-symbols-for-lguest-as-a-module.patch
__put_task_structis one of those no way in hell should this be exported things because we don't want modules messing with task lifetimes.Fortunately I can't find anything actually using this in lguest, so it looks the issue has been solved in the meantime.
To do inter-guest (ie. inter-process) I/O you really have to make sure the other side doesn't go away.
Quoted 10 lines
I also have a rather bad feeling about exporting
access_process_vm. This is the proverbial sledge hammer for access to user vm addresses and I'd rather keep it away from module programmers with "if all you have is a hammer ..." in mind.In lguest this is used by
send_dmawhich from my short reading of the code seems to be the central IPC mechanism. The double copy here doesn't look very efficient to me either. Maybe some VM folks could look into a better way to archive this that might be both more efficient and not require the export.
It's not a double copy: it's a map & copy.
If KVM develops inter-guest I/O then this could all be extracted into a helper function and made more efficient.
Quoted 4 lines
Just started to reading this (again) so no useful comment here, but it would be nice if the code could follow CodingStyle and place the || and && at the end of the line in multiline conditionals instead of at the beginning of the new one.
Surprisingly, you have a point here. Since the key purpose of lguest is as demonstration code, it meticulously match kernel style.
I shall immediately prepare a patch to convert the rest of the kernel to the correct "&& at beginning of line" style.
Rusty.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
David Miller
maintainerRe: lguest, Re: -mm merge plans for 2.6.23
From: Rusty Russell <[email protected]>
Date: Thu, 12 Jul 2007 11:21:51 +1000
Quoted 2 lines
To do inter-guest (ie. inter-process) I/O you really have to make sure the other side doesn't go away.
You should just let it exit and when it does you receive some kind of exit notification that resets your virtual device channel.
I think the reference counting approach is error and deadlock prone. Be more loose and let the events reset the virtual devices when guests go splat.
Re: lguest, Re: -mm merge plans for 2.6.23
Quoted 6 lines · David Miller
From: Rusty Russell <[email protected]>
Date: Thu, 12 Jul 2007 11:21:51 +1000Quoted 2 lines
To do inter-guest (ie. inter-process) I/O you really have to make sure the other side doesn't go away.
Quoted 6 lines
You should just let it exit and when it does you receive some kind of exit notification that resets your virtual device channel.
I think the reference counting approach is error and deadlock prone. Be more loose and let the events reset the virtual devices when guests go splat.
There are two places where we grab task refcnt. One might be avoidable (will test and get back) but the deferred wakeup isn't really:
/* We cache one process to wakeup: helps for batching & wakes outside locks. */
void set_wakeup_process(struct lguest *lg, struct task_struct *p)
{
if (p == lg->wake)
return;
if (lg->wake) {
wake_up_process(lg->wake);
put_task_struct(lg->wake);
}
lg->wake = p;
if (lg->wake)
get_task_struct(lg->wake);
}We drop the lock after I/O, and then do this wakeup. Meanwhile the other task might have exited.
I could get rid of it, but I don't think there's anything wrong with the code...
Cheers,
Rusty.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
David Miller
maintainerRe: lguest, Re: -mm merge plans for 2.6.23
From: Rusty Russell <[email protected]>
Date: Thu, 12 Jul 2007 12:48:41 +1000
Quoted 2 lines
We drop the lock after I/O, and then do this wakeup. Meanwhile the other task might have exited.
I already understand what you're doing.
Is it possible to use exit notifiers to handle this case? That's what I'm trying to suggest. :)
Re: lguest, Re: -mm merge plans for 2.6.23
Quoted 10 lines · David Miller
From: Rusty Russell <[email protected]>
Date: Thu, 12 Jul 2007 12:48:41 +1000Quoted 2 lines
We drop the lock after I/O, and then do this wakeup. Meanwhile the other task might have exited.
I already understand what you're doing.
Is it possible to use exit notifiers to handle this case? That's what I'm trying to suggest. :)
Sure, the process has /dev/lguest open, so I can do something in the close routine. Instead of keeping a reference to the tsk, I can keep a reference to the struct lguest (currently it doesn't have or need a refcnt). Then I need another lock, to protect lg->tsk.
This seems like a lot of dancing to avoid one export. If it's that important I'd far rather drop the code and do a normal wakeup under the big lguest lock for 2.6.23.
Cheers,
Rusty.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
David Miller
maintainerRe: lguest, Re: -mm merge plans for 2.6.23
Quoted 8 lines
Sure, the process has
/dev/lguestopen, so I can do something in the close routine. Instead of keeping a reference to the tsk, I can keep a reference to the struct lguest (currently it doesn't have or need a refcnt). Then I need another lock, to protectlg->tsk.This seems like a lot of dancing to avoid one export. If it's that important I'd far rather drop the code and do a normal wakeup under the big lguest lock for 2.6.23.
I'm not against the export, so use if it really helps.
Ref-counting just seems clumsy to me given how the hw assisted virtualization stuff works on platforms I am intimately familiar with :)
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Andrew Morton
maintainerRe: lguest, Re: -mm merge plans for 2.6.23
In reply to Rusty RussellQuoted 17 lines · On Thu, 12 Jul 2007 12:48:41 +1000 Rusty Russell <[email protected]> wrote:
Quoted 6 lines · David Miller
From: Rusty Russell <[email protected]>
Date: Thu, 12 Jul 2007 11:21:51 +1000Quoted 2 lines
To do inter-guest (ie. inter-process) I/O you really have to make sure the other side doesn't go away.
Quoted 6 lines
You should just let it exit and when it does you receive some kind of exit notification that resets your virtual device channel.
I think the reference counting approach is error and deadlock prone. Be more loose and let the events reset the virtual devices when guests go splat.
There are two places where we grab task refcnt. One might be avoidable (will test and get back) but the deferred wakeup isn't really:
Quoted 14 lines
/* We cache one process to wakeup: helps for batching & wakes outside locks. */
void set_wakeup_process(struct lguest *lg, struct task_struct *p)
{
if (p == lg->wake)
return;
if (lg->wake) {
wake_up_process(lg->wake);
put_task_struct(lg->wake);
}
lg->wake = p;
if (lg->wake)
get_task_struct(lg->wake);
}<handwaving>
We seem to be taking the reference against the wrong thing here. It should be against the mm, not against a task_struct?
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Re: lguest, Re: -mm merge plans for 2.6.23
Quoted 2 lines · Andrew Morton
We seem to be taking the reference against the wrong thing here. It should be against the mm, not against a
task_struct?
This is solely for the wakeup: you don't wake an mm 8)
The mm reference is held as well under the big lguest_mutex (mm gets destroyed before files get closed, so we definitely do need to hold a reference).
I just completed benchmarking: the cached wakeup with the current naive drivers makes no difference (at one stage I was playing with batched hypercalls, where it seemed to help).
Thanks Christoph, DaveM!
===
Remove export of __put_task_struct, and usage in lguest
lguest takes a reference count of tasks for two reasons. The first is
bogus: the /dev/lguest close callback will be called before the task is destroyed anyway, so no need to take a reference on open.
The second is code to defer waking up tasks for inter-guest I/O, but the current lguest drivers are too simplistic to benefit (only batched hypercalls will see an effect, and it's likely that lguests' entire I/O model will be replaced with virtio and ringbuffers anyway).
--- drivers/lguest/hypercalls.c | 1 - drivers/lguest/io.c | 18 +----------------- drivers/lguest/lg.h | 1 - drivers/lguest/lguest_user.c | 2 -- kernel/fork.c | 1 - 5 files changed, 1 insertion(+), 22 deletions(-)
===================================================================
drivers/lguest/hypercalls.c +0 -1
@@ -189,5 +189,4 @@ void do_hypercalls(struct lguest *lg)do_hcall (lg, lg->regs);clear_hcall (lg); } -set_wakeup_process (lg,NULL ); }
===================================================================
drivers/lguest/io.c +1 -17
@@ -296,7 +296,7 @@ static int dma_transfer(struct lguest *s/* Do this last so dst doesn't simply sleep on lock. */ set_bit (dst->interrupt, dstlg->irqs_pending); -set_wakeup_process (srclg, dstlg->tsk); +wake_up_process (dstlg->tsk);return i == dst->num_dmas; fail:
@@ -333,7 +333,6 @@ again:/* Give any recipients one chance to restock. */ up_read (¤t->mm->mmap_sem);mutex_unlock (&lguest_lock); -set_wakeup_process (lg,NULL ); empty++; goto again; }
@@ -360,21 +359,6 @@ void release_all_dma(struct lguest *lg)unlink_dma (&lg->dma[i]); }up_read (&lg->mm->mmap_sem); -} - -/* We cache one process to wakeup: helps for batching & wakes outside locks. */ -void set_wakeup_process (struct lguest *lg,struct task_struct *p) -{ -if (p == lg->wake) -return ; - -if (lg->wake) { -wake_up_process (lg->wake); -put_task_struct (lg->wake); - } - lg->wake = p; -if (lg->wake) -get_task_struct (lg->wake); }/* Userspace wants a dma buffer from this guest. */
===================================================================
drivers/lguest/lg.h +0 -1
@@ -240,7 +240,6 @@ void release_all_dma(struct lguest *lg);void release_all_dma (struct lguest *lg);unsigned long get_dma_buffer (struct lguest *lg,unsigned long key,unsigned long *interrupt); -void set_wakeup_process (struct lguest *lg,struct task_struct *p);/* hypercalls.c: */ void do_hypercalls (struct lguest *lg);
===================================================================
drivers/lguest/lguest_user.c +0 -2
@@ -141,7 +141,6 @@ static int initialize(struct file *file,setup_guest_gdt (lg);init_clockdev (lg); lg->tsk = current; -get_task_struct (lg->tsk); lg->mm =get_task_mm (lg->tsk);init_waitqueue_head (&lg->break_wq); lg->last_pages =NULL ;
@@ -205,7 +204,6 @@ static int close(struct inode *inode, sthrtimer_cancel (&lg->hrt);release_all_dma (lg);free_guest_pagetable (lg); -put_task_struct (lg->tsk);mmput (lg->mm);if (!IS_ERR (lg->dead))kfree (lg->dead);
===================================================================
kernel/fork.c +0 -1
@@ -128,7 +128,6 @@ void __put_task_struct(struct task_strucif (!profile_handoff_task (tsk))free_task (tsk); } -EXPORT_SYMBOL_GPL (__put_task_struct);void __init fork_init (unsigned long mempages) {
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Re: lguest, Re: -mm merge plans for 2.6.23
Quoted 7 lines · Rusty Russell
Remove export of
__put_task_struct, and usage in lguestlguest takes a reference count of tasks for two reasons. The first is
bogus: the/dev/lguestclose callback will be called before the task is destroyed anyway, so no need to take a reference on open.
What about
Open /dev/lguest
transfer fd using SCM_RIGHTS (or clone()?)
close fd in original task
exit()
?
My feeling is that if you want to be bound to a task, not a file, you need to use syscalls, not ioctls.
Signature · 7 lines
error compiling committee.c: too many arguments to function -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Re: lguest, Re: -mm merge plans for 2.6.23
Quoted 16 lines · Avi Kivity
Quoted 7 lines · Rusty Russell
Remove export of
__put_task_struct, and usage in lguestlguest takes a reference count of tasks for two reasons. The first is
bogus: the/dev/lguestclose callback will be called before the task is destroyed anyway, so no need to take a reference on open.What about
Open
/dev/lguest
transfer fd usingSCM_RIGHTS(orclone()?)
close fd in original task
exit()
Quoted 4 lines
?
My feeling is that if you want to be bound to a task, not a file, you need to use syscalls, not ioctls.
"Don't do that". You'll lose the ability to access the operations on the fd once you are no longer the original task (explicit check).,
It's not an exact match, but a file is a remarkably convenient abstraction for a non-ABI such as lguest. Of course, Carsten was talking about unifying the lguest & kvm userspace interface, so this could well change anyway.
Cheers,
Rusty.
Re: lguest, Re: -mm merge plans for 2.6.23
In reply to Rusty RussellQuoted 11 lines · Rusty Russell
This is solely for the wakeup: you don't wake an mm 8)
The mm reference is held as well under the big
lguest_mutex(mm gets destroyed before files get closed, so we definitely do need to hold a reference).I just completed benchmarking: the cached wakeup with the current naive drivers makes no difference (at one stage I was playing with batched hypercalls, where it seemed to help).
Thanks Christoph, DaveM!
The version that just got into mainline still has the __put_task_struct export despite not needing it anymore. Care to fix this up?
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Re: lguest, Re: -mm merge plans for 2.6.23
Quoted 2 lines · Christoph Hellwig
The version that just got into mainline still has the
__put_task_structexport despite not needing it anymore. Care to fix this up?
No, it got patched in then immediately patched out again. Andrew mis-mixed my patches, but there have been so many of them I find it hard to blame him.
Rusty.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Re: lguest, Re: -mm merge plans for 2.6.23
Quoted 7 lines · Rusty Russell
Quoted 2 lines · Christoph Hellwig
The version that just got into mainline still has the
__put_task_structexport despite not needing it anymore. Care to fix this up?No, it got patched in then immediately patched out again. Andrew mis-mixed my patches, but there have been so many of them I find it hard to blame him.
Indeed, the export is gone in last mainline gone.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
generic clockevents/ (hr)time(r) patches was Re: -mm merge plans for 2.6.23
In reply to Andrew MortonAndrew, Linus,
Quoted 13 lines · Andrew Morton
When replying, please rewrite the subject suitably and try to Cc: the appropriate developer(s).
i386-hpet-check-if-the-counter-works.patch nohz-fix-nohz-x86-dyntick-idle-handling.patch acpi-move-timer-broadcast-and-pmtimer-access-before-c3-arbiter-shutdown.patch clockevents-fix-typo-in-acpi_pmc.patch timekeeping-fixup-shadow-variable-argument.patch timerc-cleanup-recently-introduced-whitespace-damage.patch clockevents-remove-prototypes-of-removed-functions.patch clockevents-fix-resume-logic.patch clockevents-fix-device-replacement.patch tick-management-spread-timer-interrupt.patch
Quoted 8 lines
highres-improve-debug-output.patch hrtimer-speedup-hrtimer_enqueue.patch pcspkr-use-the-global-pit-lock.patch ntp-move-the-cmos-update-code-into-ntpc.patch i386-pit-stop-only-when-in-periodic-or-oneshot-mode.patch i386-remove-volatile-in-apicc.patch i386-hpet-assumes-boot-cpu-is-0.patch i386-move-pit-function-declarations-and-constants-to-correct-header-file.patch
These got sent to Andi as well, but the patches are independent of the x86_64 conversion.
These are bugfixes (nohz-fix-nohz-x86-dyntick-idle-handling.patch) and general improvements of the core code and the existing i386 code.
Can we please merge the above now ?
I can resend them or setup a git repo if you want.
Andi, any objections against the above i386 fixlets ?
Thanks,
tglx
Andrew Morton
maintainerRe: generic clockevents/ (hr)time(r) patches was Re: -mm merge plans for 2.6.23
Quoted 28 lines · On Thu, 12 Jul 2007 01:03:28 +0200 Thomas Gleixner <[email protected]> wrote:
Andrew, Linus,
Quoted 13 lines · Andrew Morton
When replying, please rewrite the subject suitably and try to Cc: the appropriate developer(s).
i386-hpet-check-if-the-counter-works.patch nohz-fix-nohz-x86-dyntick-idle-handling.patch acpi-move-timer-broadcast-and-pmtimer-access-before-c3-arbiter-shutdown.patch clockevents-fix-typo-in-acpi_pmc.patch timekeeping-fixup-shadow-variable-argument.patch timerc-cleanup-recently-introduced-whitespace-damage.patch clockevents-remove-prototypes-of-removed-functions.patch clockevents-fix-resume-logic.patch clockevents-fix-device-replacement.patch tick-management-spread-timer-interrupt.patch
Quoted 8 lines
highres-improve-debug-output.patch hrtimer-speedup-hrtimer_enqueue.patch pcspkr-use-the-global-pit-lock.patch ntp-move-the-cmos-update-code-into-ntpc.patch i386-pit-stop-only-when-in-periodic-or-oneshot-mode.patch i386-remove-volatile-in-apicc.patch i386-hpet-assumes-boot-cpu-is-0.patch i386-move-pit-function-declarations-and-constants-to-correct-header-file.patch
These got sent to Andi as well, but the patches are independent of the
x86_64conversion.
Quoted 9 lines
These are bugfixes (nohz-fix-nohz-x86-dyntick-idle-handling.patch) and general improvements of the core code and the existing i386 code.
Can we please merge the above now ?
I can resend them or setup a git repo if you want.
Andi, any objections against the above i386 fixlets ?
They all look pretty innocuous to me.
Could you please take a second look, decide if any of them should also be in 2.6.22.x and let me know?
Re: generic clockevents/ (hr)time(r) patches was Re: -mm merge plans for 2.6.23
Andrew,
Quoted 4 lines · Andrew Morton
They all look pretty innocuous to me.
Could you please take a second look, decide if any of them should also be in 2.6.22.x and let me know?
i386-hpet-check-if-the-counter-works.patch
pcspkr-use-the-global-pit-lock.patch
are the only candidates.
tglx
Re: [stable] generic clockevents/ (hr)time(r) patches was Re: -mm merge plans for 2.6.23
Quoted 5 lines · * Thomas Gleixner ([email protected]) wrote:
Andrew,
Quoted 2 lines · Andrew Morton
They all look pretty innocuous to me.
Quoted 7 lines
Quoted 2 lines
Could you please take a second look, decide if any of them should also be in 2.6.22.x and let me know?
i386-hpet-check-if-the-counter-works.patch
pcspkr-use-the-global-pit-lock.patchare the only candidates.
yup, come through -stable a few times, be great to get them upstream, and into .22.y
thanks,
-chris
Re: generic clockevents/ (hr)time(r) patches was Re: -mm merge plans for 2.6.23
In reply to Thomas GleixnerQuoted 10 lines · Thomas Gleixner
Andrew,
Quoted 4 lines · Andrew Morton
They all look pretty innocuous to me.
Could you please take a second look, decide if any of them should also be in 2.6.22.x and let me know?
i386-hpet-check-if-the-counter-works.patch
pcspkr-use-the-global-pit-lock.patch
Ok by me, although I suspect a lot of the cases where the hpet one was needed got resolved with the PCI HPET resource fix But it's still safer to check.
However I don't think patches should go into stable before they hit Linus' tree.
-Andi
Re: [stable] generic clockevents/ (hr)time(r) patches was Re: -mm merge plans for 2.6.23
Quoted 6 lines · * Andi Kleen ([email protected]) wrote:
Ok by me, although I suspect a lot of the cases where the hpet one was needed got resolved with the PCI HPET resource fix But it's still safer to check.
However I don't think patches should go into stable before they hit Linus' tree.
Agreed, we're just waiting ;-)
thanks,
-chris
Re: generic clockevents/ (hr)time(r) patches was Re: -mm merge plans for 2.6.23
In reply to Thomas GleixnerQuoted 2 lines
Andi, any objections against the above i386 fixlets ?
No, they are fine for me.
-Andi
Andrew Morton
maintainerRe: generic clockevents/ (hr)time(r) patches was Re: -mm merge plans for 2.6.23
Quoted 5 lines · On Thu, 12 Jul 2007 01:59:23 +0200 Andi Kleen <[email protected]> wrote:
Quoted 2 lines
Andi, any objections against the above i386 fixlets ?
No, they are fine for me.
OK, I queued them up for an akpm->linus transfer. Which will of course be abandoned if an akpm->andi or andi->linus merge happens in the next week or so.
fault vs invalidate race (Re: -mm merge plans for 2.6.23)
In reply to Andrew MortonQuoted 11 lines · Andrew Morton
mm-fix-fault-vs-invalidate-race-for-linear-mappings.patch mm-merge-populate-and-nopage-into-fault-fixes-nonlinear.patch mm-merge-nopfn-into-fault.patch convert-hugetlbfs-to-use-vm_ops-fault.patch mm-remove-legacy-cruft.patch mm-debug-check-for-the-fault-vs-invalidate-race.patch mm-fix-clear_page_dirty_for_io-vs-fault-race.patch invalidate_mapping_pages-add-cond_resched.patch ocfs2-release-page-lock-before-calling-page_mkwrite.patch document-page_mkwrite-locking.patch
Quoted 2 lines
The fault-vs-invalidate race fix. I have belatedly learned that these need more work, so their state is uncertain.
The more work may turn out being too much for you (although it is nothing exactly tricky that would introduce subtle bugs, it is a fair amont of churn).
However, in that case we can still merge these two:
mm-fix-fault-vs-invalidate-race-for-linear-mappings.patch mm-fix-clear_page_dirty_for_io-vs-fault-race.patch
Which fix real bugs that need fixing (and will at least help to get some of my patches off your hands).
Signature · 7 lines
SUSE Labs, Novell Inc. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
block_page_mkwrite? (Re: fault vs invalidate race (Re: -mm merge plans for 2.6.23))
Quoted 8 lines · Nick Piggin
Quoted 3 lines · Andrew Morton
The fault-vs-invalidate race fix. I have belatedly learned that these need
more work, so their state is uncertain.The more work may turn out being too much for you (although it is nothing exactly tricky that would introduce subtle bugs, it is a fair amont of churn).
OK, so does that mean we can finally get the block_page_mkwrite patches merged?
i.e.:
http://marc.info/?l=linux-kernel&m=117426058311032&w=2
http://marc.info/?l=linux-kernel&m=117426070111136&w=2
I've got up-to-date versions of them ready to go and they've been consistently tested thanks to the XFSQA test I wrote for the bug that it fixes. I've been holding them out-of-tree for months now because ->fault was supposed to supercede this interface.....
Cheers,
Dave.
Signature · 9 lines
Dave Chinner Principal Engineer SGI Australian Software Group -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Re: block_page_mkwrite? (Re: fault vs invalidate race (Re: -mm merge plans for 2.6.23))
Quoted 16 lines · David Chinner
Quoted 7 lines · Nick Piggin
Quoted 2 lines · Andrew Morton
The fault-vs-invalidate race fix. I have belatedly learned that these need more work, so their state is uncertain.
The more work may turn out being too much for you (although it is nothing exactly tricky that would introduce subtle bugs, it is a fair amont of churn).
OK, so does that mean we can finally get the
block_page_mkwritepatches merged?i.e.:
Quoted 7 lines
http://marc.info/?l=linux-kernel&m=117426058311032&w=2
http://marc.info/?l=linux-kernel&m=117426070111136&w=2I've got up-to-date versions of them ready to go and they've been consistently tested thanks to the XFSQA test I wrote for the bug that it fixes. I've been holding them out-of-tree for months now because ->fault was supposed to supercede this interface.....
Yeah, as I've said, don't hold them back because of me. They are relatively simple enough that I don't see why they couldn't be merged in this window.
Signature · 7 lines
SUSE Labs, Novell Inc. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 3 lines · Andrew Morton
use-menuconfig-objects-isdn-config_isdn_i4l.patch
tilman didn't like it - might drop
Or replace by his suggestion patch ( http://lkml.org/lkml/2007/5/31/222 )
Jan
Am 13.07.2007 11:46 schrieb Jan Engelhardt:
Quoted 7 lines · Andrew Morton
Quoted 4 lines
use-menuconfig-objects-isdn-config_isdn_i4l.patch
tilman didn't like it - might drop
Or replace by his suggestion patch ( http://lkml.org/lkml/2007/5/31/222 )
That posting was just a change proposal for the drivers/isdn/Kconfig part, not a complete replacement for the entire patch. If you'd care to reissue that patch with the modification I proposed, I'll gladly ack it. Alternatively I can also send a full replacement patch if you prefer.
Regards,
Tilman
Signature · 4 lines
Tilman Schmidt E-Mail: [email protected] Bonn, Germany Diese Nachricht besteht zu 100% aus wiederverwerteten Bits. Ungeöffnet mindestens haltbar bis: (siehe Rückseite)
Quoted 5 lines · Tilman Schmidt
Am 13.07.2007 11:46 schrieb Jan Engelhardt:
Quoted 4 lines · Andrew Morton
Quoted 3 lines
use-menuconfig-objects-isdn-config_isdn_i4l.patch
Quoted 8 lines
Quoted 3 lines
Quoted 1 line
tilman didn't like it - might drop
Or replace by his suggestion patch ( http://lkml.org/lkml/2007/5/31/222 )
That posting was just a change proposal for the
drivers/isdn/Kconfigpart, not a complete replacement for the entire patch. If you'd care to reissue that patch with the modification I proposed, I'll gladly ack it. Alternatively I can also send a full replacement patch if you prefer.
Since I did not really see much of a difference between our two approaches, I'd be grateful if you could send a full replacement in the hopes that I see the global picture.
Thanks,
Jan
A message that is not in the archive (sent off-list or not yet received): [email protected]
Re: [PATCH] Use menuconfig objects - CONFIG_ISDN_I4L [v2]
Quoted 6 lines
Remove a menu statement and several dependencies from the
Kconfigfiles in thedrivers/isdntree as they have become unnecessary by the transformation ofCONFIG_ISDNfrom "menu, config" into "menuconfig".
(Modified version of a patch originally proposed by Jan Engelhardt.)
Quoted 7 lines
Signed-off-by Tilman Schmidt <[email protected]>---
This is my alternative proposal for use-menuconfig-objects-isdn-config_isdn_i4l.patch (patch 2 of 6 in Jan's "Use menuconfig objects 4 - ISDN" series). It must go between patch 1 and 3 of that series because they touch some of the same files.
This looks good to me. (Applies on top of today's git.)
Thanks,
Jan
Re: [more PATCHes] Use menuconfig objects - CONFIG_ISDN_I4L
In reply to a message not in the archiveHi,
here are two more changes I propose for the isdn submenu(s). They go on top of Tilman's patch; each of the two following patches is independent of another.
Opinions please :)
Jan
PATCH 1/2 Use menuconfig objects - ISDN
Unclutter the ISDN menu a tiny bit by moving ISDN4Linux and the CAPI2.0 layers into their own menu.
--- drivers/isdn/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/isdn/Kconfig +2 -2
@@ -21,7 +21,7 @@ menuconfig ISDN if ISDN -config ISDN_I4L +menuconfig ISDN_I4L tristate "Old ISDN4Linux (deprecated)" ---help--- This driver allows you to use an ISDN adapter for networking
@@ -43,7 +43,7 @@ if ISDN_I4L source "drivers/isdn/i4l/Kconfig" endif -config ISDN_CAPI +menuconfig ISDN_CAPI tristate "CAPI 2.0 subsystem" help This provides the CAPI (Common ISDN Application Programming
PATCH 2/2 Use menuconfig objects - ISDN/Gigaset
In reply to Jan EngelhardtChange Kconfig objects from "menu, config" into "menuconfig" so that the user can disable the whole feature without having to enter the menu first.
--- drivers/isdn/gigaset/Kconfig | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)
drivers/isdn/gigaset/Kconfig +2 -6
@@ -1,6 +1,4 @@ -menu "Siemens Gigaset" - -config ISDN_DRV_GIGASET +menuconfig ISDN_DRV_GIGASET tristate "Siemens Gigaset support (isdn)" select CRC_CCITT select BITREVERSE
@@ -53,6 +51,4 @@ config GIGASET_UNDOCREQ features like configuration mode of M105, say yes. If you care about your device, say no. -endif - -endmenu +endif # ISDN_DRV_GIGASET != n
Re: [more PATCHes] Use menuconfig objects - CONFIG_ISDN_I4L
In reply to Jan EngelhardtHi,
sorry for the late reply.
Quoted 4 lines · On 18.07.2007 20:22 Jan Engelhardt wrote:
here are two more changes I propose for the isdn submenu(s). They go on top of Tilman's patch; each of the two following patches is independent of another.
Opinions please :)
These are fine by me.
Thanks
Tilman
Signature · 4 lines
Tilman Schmidt E-Mail: [email protected] Bonn, Germany Diese Nachricht besteht zu 100% aus wiederverwerteten Bits. Ungeöffnet mindestens haltbar bis: (siehe Rückseite)
Andrew Morton
maintainerunprivileged mounts (was: Re: -mm merge plans for 2.6.23)
In reply to Andrew MortonQuoted 11 lines · On Tue, 10 Jul 2007 01:31:52 -0700 Andrew Morton <[email protected]>…
unprivileged-mounts-add-user-mounts-to-the-kernel.patch unprivileged-mounts-allow-unprivileged-umount.patch unprivileged-mounts-account-user-mounts.patch unprivileged-mounts-propagate-error-values-from-clone_mnt.patch unprivileged-mounts-allow-unprivileged-bind-mounts.patch unprivileged-mounts-put-declaration-of-put_filesystem-in-fsh.patch unprivileged-mounts-allow-unprivileged-mounts.patch unprivileged-mounts-allow-unprivileged-fuse-mounts.patch unprivileged-mounts-propagation-inherit-owner-from-parent.patch unprivileged-mounts-add-no-submounts-flag.patch
Quoted 1 line
Don't know. Need to ping suitable developers over this work.
ping.