1. 14 Mar, 2012 7 commits
  2. 13 Mar, 2012 12 commits
  3. 12 Mar, 2012 11 commits
    • Peter Zijlstra's avatar
      perf/x86: Fix local vs remote memory events for NHM/WSM · 87e24f4b
      Peter Zijlstra authored
      Verified using the below proglet.. before:
      
      [root@westmere ~]# perf stat -e node-stores -e node-store-misses ./numa 0
      remote write
      
       Performance counter stats for './numa 0':
      
               2,101,554 node-stores
               2,096,931 node-store-misses
      
             5.021546079 seconds time elapsed
      
      [root@westmere ~]# perf stat -e node-stores -e node-store-misses ./numa 1
      local write
      
       Performance counter stats for './numa 1':
      
                 501,137 node-stores
                     199 node-store-misses
      
             5.124451068 seconds time elapsed
      
      After:
      
      [root@westmere ~]# perf stat -e node-stores -e node-store-misses ./numa 0
      remote write
      
       Performance counter stats for './numa 0':
      
               2,107,516 node-stores
               2,097,187 node-store-misses
      
             5.012755149 seconds time elapsed
      
      [root@westmere ~]# perf stat -e node-stores -e node-store-misses ./numa 1
      local write
      
       Performance counter stats for './numa 1':
      
               2,063,355 node-stores
                     165 node-store-misses
      
             5.082091494 seconds time elapsed
      
      #define _GNU_SOURCE
      
      #include <sched.h>
      #include <stdio.h>
      #include <errno.h>
      #include <sys/mman.h>
      #include <sys/types.h>
      #include <dirent.h>
      #include <signal.h>
      #include <unistd.h>
      #include <numaif.h>
      #include <stdlib.h>
      
      #define SIZE (32*1024*1024)
      
      volatile int done;
      
      void sig_done(int sig)
      {
      	done = 1;
      }
      
      int main(int argc, char **argv)
      {
      	cpu_set_t *mask, *mask2;
      	size_t size;
      	int i, err, t;
      	int nrcpus = 1024;
      	char *mem;
      	unsigned long nodemask = 0x01; /* node 0 */
      	DIR *node;
      	struct dirent *de;
      	int read = 0;
      	int local = 0;
      
      	if (argc < 2) {
      		printf("usage: %s [0-3]\n", argv[0]);
      		printf("  bit0 - local/remote\n");
      		printf("  bit1 - read/write\n");
      		exit(0);
      	}
      
      	switch (atoi(argv[1])) {
      	case 0:
      		printf("remote write\n");
      		break;
      	case 1:
      		printf("local write\n");
      		local = 1;
      		break;
      	case 2:
      		printf("remote read\n");
      		read = 1;
      		break;
      	case 3:
      		printf("local read\n");
      		local = 1;
      		read = 1;
      		break;
      	}
      
      	mask = CPU_ALLOC(nrcpus);
      	size = CPU_ALLOC_SIZE(nrcpus);
      	CPU_ZERO_S(size, mask);
      
      	node = opendir("/sys/devices/system/node/node0/");
      	if (!node)
      		perror("opendir");
      	while ((de = readdir(node))) {
      		int cpu;
      
      		if (sscanf(de->d_name, "cpu%d", &cpu) == 1)
      			CPU_SET_S(cpu, size, mask);
      	}
      	closedir(node);
      
      	mask2 = CPU_ALLOC(nrcpus);
      	CPU_ZERO_S(size, mask2);
      	for (i = 0; i < size; i++)
      		CPU_SET_S(i, size, mask2);
      	CPU_XOR_S(size, mask2, mask2, mask); // invert
      
      	if (!local)
      		mask = mask2;
      
      	err = sched_setaffinity(0, size, mask);
      	if (err)
      		perror("sched_setaffinity");
      
      	mem = mmap(0, SIZE, PROT_READ|PROT_WRITE,
      			MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);
      	err = mbind(mem, SIZE, MPOL_BIND, &nodemask, 8*sizeof(nodemask), MPOL_MF_MOVE);
      	if (err)
      		perror("mbind");
      
      	signal(SIGALRM, sig_done);
      	alarm(5);
      
      	if (!read) {
      		while (!done) {
      			for (i = 0; i < SIZE; i++)
      				mem[i] = 0x01;
      		}
      	} else {
      		while (!done) {
      			for (i = 0; i < SIZE; i++)
      				t += *(volatile char *)(mem + i);
      		}
      	}
      
      	return 0;
      }
      Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: <stable@kernel.org>
      Link: http://lkml.kernel.org/n/tip-tq73sxus35xmqpojf7ootxgs@git.kernel.orgSigned-off-by: default avatarIngo Molnar <mingo@elte.hu>
      87e24f4b
    • roel's avatar
      arch/tile: misplaced parens near likely · cf8c1daf
      roel authored
      Parentheses were missing.
      Signed-off-by: default avatarRoel Kluin <roel.kluin@gmail.com>
      Signed-off-by: default avatarChris Metcalf <cmetcalf@tilera.com>
      cf8c1daf
    • Chris Metcalf's avatar
      arch/tile: sync up the defconfig files to the tip · 7ed725cf
      Chris Metcalf authored
      This was inspired by mchehab@redhat.com's observation that we
      didn't have EDAC configured on by default in both files.  In addition,
      we were setting INITRAMFS_SOURCE to a non-empty string, which isn't
      a very common default and required editing to do test builds.
      Signed-off-by: default avatarChris Metcalf <cmetcalf@tilera.com>
      7ed725cf
    • Chris Metcalf's avatar
      arch/tile: Fix up from commit 8a25a2fd · 688b4db0
      Chris Metcalf authored
      This was Kay Siever's bombing to convert 'cpu' to a regular subsystem.
      The change left a bogus second argument to sysfs_create_file().
      Signed-off-by: default avatarChris Metcalf <cmetcalf@tilera.com>
      688b4db0
    • Stanislaw Gruszka's avatar
      rt2x00: fix random stalls · 3780d038
      Stanislaw Gruszka authored
      Is possible that we stop queue and then do not wake up it again,
      especially when packets are transmitted fast. That can be easily
      reproduced with modified tx queue entry_num to some small value e.g. 16.
      
      If mac80211 already hold local->queue_stop_reason_lock, then we can wait
      on that lock in both rt2x00queue_pause_queue() and
      rt2x00queue_unpause_queue(). After drooping ->queue_stop_reason_lock
      is possible that __ieee80211_wake_queue() will be performed before
      __ieee80211_stop_queue(), hence we stop queue and newer wake up it
      again.
      
      Another race condition is possible when between rt2x00queue_threshold()
      check and rt2x00queue_pause_queue() we will process all pending tx
      buffers on different cpu. This might happen if for example interrupt
      will be triggered on cpu performing rt2x00mac_tx().
      
      To prevent race conditions serialize pause/unpause by queue->tx_lock.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarStanislaw Gruszka <sgruszka@redhat.com>
      Acked-by: default avatarGertjan van Wingerde <gwingerde@gmail.com>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      3780d038
    • Stanislaw Gruszka's avatar
      iwl3945: fix possible il->txq NULL pointer dereference in delayed works · 210787e8
      Stanislaw Gruszka authored
      On il3945_down procedure we free tx queue data and nullify il->txq
      pointer. After that we drop mutex and then cancel delayed works. There
      is possibility, that after drooping mutex and before the cancel, some
      delayed work will start and crash while trying to send commands to
      the device. For example, here is reported crash in
      il3945_bg_reg_txpower_periodic():
      https://bugzilla.kernel.org/show_bug.cgi?id=42766#c10
      
      Patch fix problem by adding il->txq check on works that send commands,
      hence utilize tx queue.
      Reported-by: default avatarClemens Eisserer <linuxhippy@gmail.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarStanislaw Gruszka <sgruszka@redhat.com>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      210787e8
    • Xi Wang's avatar
      panasonic-laptop: avoid overflow in acpi_pcc_hotkey_add() · e424fb8c
      Xi Wang authored
      num_sifr could go negative since acpi_pcc_get_sqty() returns -EINVAL
      on error.  Then it could bypass the sanity check (num_sifr > 255).
      The subsequent call to kzalloc() would allocate a small buffer, leading
      to a memory corruption.
      Signed-off-by: default avatarXi Wang <xi.wang@gmail.com>
      Signed-off-by: default avatarMatthew Garrett <mjg@redhat.com>
      e424fb8c
    • Ike Panhc's avatar
      acer-wmi: No wifi rfkill on Lenovo machines · 461e7437
      Ike Panhc authored
      We have several reports which says acer-wmi is loaded on ideapads
      and register rfkill for wifi which can not be unblocked.
      
      Since ideapad-laptop also register rfkill for wifi and it works
      reliably, it will be fine acer-wmi is not going to register rfkill
      for wifi once VPC2004 is found.
      
      Also put IBM0068/LEN0068 in the list. Though thinkpad_acpi has no
      wifi rfkill capability, there are reports which says acer-wmi also
      block wireless on Thinkpad E520/E420.
      Signed-off-by: default avatarIke Panhc <ike.pan@canonical.com>
      Signed-off-by: default avatarMatthew Garrett <mjg@redhat.com>
      461e7437
    • Robert Gerlach's avatar
      Fujitsu tablet extras driver · 2d24c490
      Robert Gerlach authored
      This patch adds support for some of the devices within a wide variety
      of Fujitsu Tablet Computers, both convertibles and slates. Primarily
      it allows for the automatic detection of the tablet/notebook mode for
      convertible tablet pc's, and orientation for docked slates. It also
      adds support for the application panel buttons usually found next to
      the tablet screen, and docking station detection for slates.
      Signed-off-by: default avatarRobert Gerlach <khnz@gmx.de>
      Signed-off-by: default avatarMatthew Garrett <mjg@redhat.com>
      2d24c490
    • Ben Hutchings's avatar
      x86: Add amilo-rfkill driver for some Fujitsu-Siemens Amilo laptops · c215ab9a
      Ben Hutchings authored
      An rfkill driver based on the fsaa1655g and fsam7440 drivers for
      Fujitsu-Siemens Amilo A1655 and M7440 models found at:
      
      http://sourceforge.net/projects/fsaa1655g/
      http://sourceforge.net/projects/fsam7440/
      
      This adds DMI matching, replaces the procfs files with rfkill devices,
      and uses the proper functions to write to the i8042 safely.
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      Signed-off-by: default avatarMatthew Garrett <mjg@redhat.com>
      c215ab9a
    • Tom Herbert's avatar
      dql: Fix undefined jiffies · 930c514f
      Tom Herbert authored
      In some configurations, jiffies may be undefined in
      lib/dynamic_queue_limits.c.  Adding include of jiffies.h to avoid
      this.
      Signed-off-by: default avatarTom Herbert <therbert@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      930c514f
  4. 11 Mar, 2012 2 commits
  5. 10 Mar, 2012 8 commits
    • Al Viro's avatar
      restore smp_mb() in unlock_new_inode() · 310fa7a3
      Al Viro authored
      wait_on_inode() doesn't have ->i_lock
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      310fa7a3
    • Miklos Szeredi's avatar
      vfs: fix return value from do_last() · 7f6c7e62
      Miklos Szeredi authored
      complete_walk() returns either ECHILD or ESTALE.  do_last() turns this into
      ECHILD unconditionally.  If not in RCU mode, this error will reach userspace
      which is complete nonsense.
      Signed-off-by: default avatarMiklos Szeredi <mszeredi@suse.cz>
      CC: stable@vger.kernel.org
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      7f6c7e62
    • Miklos Szeredi's avatar
      vfs: fix double put after complete_walk() · 097b180c
      Miklos Szeredi authored
      complete_walk() already puts nd->path, no need to do it again at cleanup time.
      
      This would result in Oopses if triggered, apparently the codepath is not too
      well exercised.
      Signed-off-by: default avatarMiklos Szeredi <mszeredi@suse.cz>
      CC: stable@vger.kernel.org
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      097b180c
    • Linus Torvalds's avatar
      Linux 3.3-rc7 · fde7d904
      Linus Torvalds authored
      fde7d904
    • Jan Kara's avatar
      udf: Fix deadlock in udf_release_file() · f6940fe9
      Jan Kara authored
      udf_release_file() can be called from munmap() path with mmap_sem held.  Thus
      we cannot take i_mutex there because that ranks above mmap_sem. Luckily,
      i_mutex is not needed in udf_release_file() anymore since protection by
      i_data_sem is enough to protect from races with write and truncate.
      Reported-by: default avatarAl Viro <viro@ZenIV.linux.org.uk>
      Reviewed-by: default avatarNamjae Jeon <linkinjeon@gmail.com>
      Signed-off-by: default avatarJan Kara <jack@suse.cz>
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      f6940fe9
    • Tyler Hicks's avatar
      vfs: Correctly set the dir i_mutex lockdep class · 978d6d8c
      Tyler Hicks authored
      9a7aa12f introduced additional logic around setting the i_mutex
      lockdep class for directory inodes. The idea was that some filesystems
      may want their own special lockdep class for different directory
      inodes and calling unlock_new_inode() should not clobber one of
      those special classes.
      
      I believe that the added conditional, around the *negated* return value
      of lockdep_match_class(), caused directory inodes to be placed in the
      wrong lockdep class.
      
      inode_init_always() sets the i_mutex lockdep class with i_mutex_key for
      all inodes. If the filesystem did not change the class during inode
      initialization, then the conditional mentioned above was false and the
      directory inode was incorrectly left in the non-directory lockdep class.
      If the filesystem did set a special lockdep class, then the conditional
      mentioned above was true and that class was clobbered with
      i_mutex_dir_key.
      
      This patch removes the negation from the conditional so that the i_mutex
      lockdep class is properly set for directory inodes. Special classes are
      preserved and directory inodes with unmodified classes are set with
      i_mutex_dir_key.
      Signed-off-by: default avatarTyler Hicks <tyhicks@canonical.com>
      Reviewed-by: default avatarJan Kara <jack@suse.cz>
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      978d6d8c
    • Al Viro's avatar
      aio: fix the "too late munmap()" race · c7b28555
      Al Viro authored
      Current code has put_ioctx() called asynchronously from aio_fput_routine();
      that's done *after* we have killed the request that used to pin ioctx,
      so there's nothing to stop io_destroy() waiting in wait_for_all_aios()
      from progressing.  As the result, we can end up with async call of
      put_ioctx() being the last one and possibly happening during exit_mmap()
      or elf_core_dump(), neither of which expects stray munmap() being done
      to them...
      
      We do need to prevent _freeing_ ioctx until aio_fput_routine() is done
      with that, but that's all we care about - neither io_destroy() nor
      exit_aio() will progress past wait_for_all_aios() until aio_fput_routine()
      does really_put_req(), so the ioctx teardown won't be done until then
      and we don't care about the contents of ioctx past that point.
      
      Since actual freeing of these suckers is RCU-delayed, we don't need to
      bump ioctx refcount when request goes into list for async removal.
      All we need is rcu_read_lock held just over the ->ctx_lock-protected
      area in aio_fput_routine().
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      Reviewed-by: default avatarJeff Moyer <jmoyer@redhat.com>
      Acked-by: default avatarBenjamin LaHaise <bcrl@kvack.org>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      c7b28555
    • Al Viro's avatar
      aio: fix io_setup/io_destroy race · 86b62a2c
      Al Viro authored
      Have ioctx_alloc() return an extra reference, so that caller would drop it
      on success and not bother with re-grabbing it on failure exit.  The current
      code is obviously broken - io_destroy() from another thread that managed
      to guess the address io_setup() would've returned would free ioctx right
      under us; gets especially interesting if aio_context_t * we pass to
      io_setup() points to PROT_READ mapping, so put_user() fails and we end
      up doing io_destroy() on kioctx another thread has just got freed...
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      Acked-by: default avatarBenjamin LaHaise <bcrl@kvack.org>
      Reviewed-by: default avatarJeff Moyer <jmoyer@redhat.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      86b62a2c