~ubuntu-branches/debian/wheezy/linux-2.6/wheezy

« back to all changes in this revision

Viewing changes to init/main.c

  • Committer: Bazaar Package Importer
  • Author(s): Ben Hutchings, Ben Hutchings, Aurelien Jarno
  • Date: 2011-06-07 12:14:05 UTC
  • mfrom: (43.1.9 sid)
  • Revision ID: james.westby@ubuntu.com-20110607121405-i3h1rd7nrnd2b73h
Tags: 2.6.39-2
[ Ben Hutchings ]
* [x86] Enable BACKLIGHT_APPLE, replacing BACKLIGHT_MBP_NVIDIA
  (Closes: #627492)
* cgroups: Disable memory resource controller by default. Allow it
  to be enabled using kernel parameter 'cgroup_enable=memory'.
* rt2800usb: Enable support for more USB devices including
  Linksys WUSB600N (Closes: #596626) (this change was accidentally
  omitted from 2.6.39-1)
* [x86] Remove Celeron from list of processors supporting PAE. Most
  'Celeron M' models do not.
* Update debconf template translations:
  - Swedish (Martin Bagge) (Closes: #628932)
  - French (David Prévot) (Closes: #628191)
* aufs: Update for 2.6.39 (Closes: #627837)
* Add stable 2.6.39.1, including:
  - ext4: dont set PageUptodate in ext4_end_bio()
  - pata_cmd64x: fix boot crash on parisc (Closes: #622997, #622745)
  - ext3: Fix fs corruption when make_indexed_dir() fails
  - netfilter: nf_ct_sip: validate Content-Length in TCP SIP messages
  - sctp: fix race between sctp_bind_addr_free() and
    sctp_bind_addr_conflict()
  - sctp: fix memory leak of the ASCONF queue when free asoc
  - md/bitmap: fix saving of events_cleared and other state
  - cdc_acm: Fix oops when Droids MuIn LCD is connected
  - cx88: Fix conversion from BKL to fine-grained locks (Closes: #619827)
  - keys: Set cred->user_ns in key_replace_session_keyring (CVE-2011-2184)
  - tmpfs: fix race between truncate and writepage
  - nfs41: Correct offset for LAYOUTCOMMIT
  - xen/mmu: fix a race window causing leave_mm BUG()
  - ext4: fix possible use-after-free in ext4_remove_li_request()
  For the complete list of changes, see:
   http://www.kernel.org/pub/linux/kernel/v2.6/ChangeLog-2.6.39.1
* Bump ABI to 2
* netfilter: Enable IP_SET, IP_SET_BITMAP_IP, IP_SET_BITMAP_IPMAC,
  IP_SET_BITMAP_PORT, IP_SET_HASH_IP, IP_SET_HASH_IPPORT,
  IP_SET_HASH_IPPORTIP, IP_SET_HASH_IPPORTNET, IP_SET_HASH_NET,
  IP_SET_HASH_NETPORT, IP_SET_LIST_SET, NETFILTER_XT_SET as modules
  (Closes: #629401)

[ Aurelien Jarno ]
* [mipsel/loongson-2f] Disable_SCSI_LPFC to workaround GCC ICE.

Show diffs side-by-side

added added

removed removed

Lines of Context:
129
129
static char *execute_command;
130
130
static char *ramdisk_execute_command;
131
131
 
132
 
#ifdef CONFIG_SMP
133
 
/* Setup configured maximum number of CPUs to activate */
134
 
unsigned int setup_max_cpus = NR_CPUS;
135
 
EXPORT_SYMBOL(setup_max_cpus);
136
 
 
137
 
 
138
 
/*
139
 
 * Setup routine for controlling SMP activation
140
 
 *
141
 
 * Command-line option of "nosmp" or "maxcpus=0" will disable SMP
142
 
 * activation entirely (the MPS table probe still happens, though).
143
 
 *
144
 
 * Command-line option of "maxcpus=<NUM>", where <NUM> is an integer
145
 
 * greater than 0, limits the maximum number of CPUs activated in
146
 
 * SMP mode to <NUM>.
147
 
 */
148
 
 
149
 
void __weak arch_disable_smp_support(void) { }
150
 
 
151
 
static int __init nosmp(char *str)
152
 
{
153
 
        setup_max_cpus = 0;
154
 
        arch_disable_smp_support();
155
 
 
156
 
        return 0;
157
 
}
158
 
 
159
 
early_param("nosmp", nosmp);
160
 
 
161
 
/* this is hard limit */
162
 
static int __init nrcpus(char *str)
163
 
{
164
 
        int nr_cpus;
165
 
 
166
 
        get_option(&str, &nr_cpus);
167
 
        if (nr_cpus > 0 && nr_cpus < nr_cpu_ids)
168
 
                nr_cpu_ids = nr_cpus;
169
 
 
170
 
        return 0;
171
 
}
172
 
 
173
 
early_param("nr_cpus", nrcpus);
174
 
 
175
 
static int __init maxcpus(char *str)
176
 
{
177
 
        get_option(&str, &setup_max_cpus);
178
 
        if (setup_max_cpus == 0)
179
 
                arch_disable_smp_support();
180
 
 
181
 
        return 0;
182
 
}
183
 
 
184
 
early_param("maxcpus", maxcpus);
185
 
#else
186
 
static const unsigned int setup_max_cpus = NR_CPUS;
187
 
#endif
188
 
 
189
132
/*
190
133
 * If set, this is an indication to the drivers that reset the underlying
191
134
 * device before going ahead with the initialization otherwise driver might
362
305
__setup("rdinit=", rdinit_setup);
363
306
 
364
307
#ifndef CONFIG_SMP
365
 
 
 
308
static const unsigned int setup_max_cpus = NR_CPUS;
366
309
#ifdef CONFIG_X86_LOCAL_APIC
367
310
static void __init smp_init(void)
368
311
{
374
317
 
375
318
static inline void setup_nr_cpu_ids(void) { }
376
319
static inline void smp_prepare_cpus(unsigned int maxcpus) { }
377
 
 
378
 
#else
379
 
 
380
 
/* Setup number of possible processor ids */
381
 
int nr_cpu_ids __read_mostly = NR_CPUS;
382
 
EXPORT_SYMBOL(nr_cpu_ids);
383
 
 
384
 
/* An arch may set nr_cpu_ids earlier if needed, so this would be redundant */
385
 
static void __init setup_nr_cpu_ids(void)
386
 
{
387
 
        nr_cpu_ids = find_last_bit(cpumask_bits(cpu_possible_mask),NR_CPUS) + 1;
388
 
}
389
 
 
390
 
/* Called by boot processor to activate the rest. */
391
 
static void __init smp_init(void)
392
 
{
393
 
        unsigned int cpu;
394
 
 
395
 
        /* FIXME: This should be done in userspace --RR */
396
 
        for_each_present_cpu(cpu) {
397
 
                if (num_online_cpus() >= setup_max_cpus)
398
 
                        break;
399
 
                if (!cpu_online(cpu))
400
 
                        cpu_up(cpu);
401
 
        }
402
 
 
403
 
        /* Any cleanup work */
404
 
        printk(KERN_INFO "Brought up %ld CPUs\n", (long)num_online_cpus());
405
 
        smp_cpus_done(setup_max_cpus);
406
 
}
407
 
 
408
320
#endif
409
321
 
410
322
/*
875
787
         * init can run on any cpu.
876
788
         */
877
789
        set_cpus_allowed_ptr(current, cpu_all_mask);
878
 
        /*
879
 
         * Tell the world that we're going to be the grim
880
 
         * reaper of innocent orphaned children.
881
 
         *
882
 
         * We don't want people to have to make incorrect
883
 
         * assumptions about where in the task array this
884
 
         * can be found.
885
 
         */
886
 
        init_pid_ns.child_reaper = current;
887
790
 
888
791
        cad_pid = task_pid(current);
889
792