0ee1735671
We don't need them anymore, because unroutable irqs just don't get touched anymore, and we have the assigned_obj pointer to gather our mask value from during activation. Note - This removal does necessecitate the removal of affinity hint, but we'll be reimplementing that soon, as the prior policy was rather inflexible.
65 lines
1.6 KiB
C
65 lines
1.6 KiB
C
/*
|
|
* Copyright (C) 2006, Intel Corporation
|
|
*
|
|
* This file is part of irqbalance
|
|
*
|
|
* This program file 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; version 2 of the License.
|
|
*
|
|
* 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 in a file named COPYING; if not, write to the
|
|
* Free Software Foundation, Inc.,
|
|
* 51 Franklin Street, Fifth Floor,
|
|
* Boston, MA 02110-1301 USA
|
|
*/
|
|
|
|
/*
|
|
* This file contains the code to communicate a selected distribution / mapping
|
|
* of interrupts to the kernel.
|
|
*/
|
|
#include "config.h"
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <unistd.h>
|
|
#include <stdint.h>
|
|
|
|
#include "irqbalance.h"
|
|
|
|
|
|
static void activate_mapping(struct irq_info *info, void *data __attribute__((unused)))
|
|
{
|
|
char buf[PATH_MAX];
|
|
FILE *file;
|
|
|
|
/*
|
|
* only activate mappings for irqs that have moved
|
|
*/
|
|
if (!info->moved)
|
|
return;
|
|
|
|
if (!info->assigned_obj)
|
|
return;
|
|
|
|
|
|
sprintf(buf, "/proc/irq/%i/smp_affinity", info->irq);
|
|
file = fopen(buf, "w");
|
|
if (!file)
|
|
return;
|
|
|
|
cpumask_scnprintf(buf, PATH_MAX, info->assigned_obj->mask);
|
|
fprintf(file, "%s", buf);
|
|
fclose(file);
|
|
info->moved = 0; /*migration is done*/
|
|
}
|
|
|
|
void activate_mappings(void)
|
|
{
|
|
for_each_irq(NULL, activate_mapping, NULL);
|
|
}
|