linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: William Lee Irwin III <wli@holomorphy.com>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: 2.6.0-test5-mm1
Date: Wed, 10 Sep 2003 23:53:59 -0700	[thread overview]
Message-ID: <20030911065359.GS4306@holomorphy.com> (raw)
In-Reply-To: <20030908235028.7dbd321b.akpm@osdl.org>

On Mon, Sep 08, 2003 at 11:50:28PM -0700, Andrew Morton wrote:
> ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.0-test5/2.6.0-test5-mm1/
> Small fixes, mainly.

Here's another one.

any_online_cpu() is required to and with cpu_online_map before
attempting to find an online cpu somewhere in the map; this patch adds
that logic to the implementation(s) of any_online_cpu().

Untested, but apparently necessary e.g. for set_cpus_allowed() not to oops.


-- wli



===== include/asm-generic/cpumask_arith.h 1.1 vs edited =====
--- 1.1/include/asm-generic/cpumask_arith.h	Mon Aug 18 19:46:23 2003
+++ edited/include/asm-generic/cpumask_arith.h	Wed Sep 10 23:46:36 2003
@@ -27,7 +27,12 @@
 #define cpus_shift_right(dst, src, n)	do { dst = (src) >> (n); } while (0)
 #define cpus_shift_left(dst, src, n)	do { dst = (src) << (n); } while (0)
 
-#define any_online_cpu(map)		({ (map) ? first_cpu(map) : NR_CPUS; })
+#define any_online_cpu(map)			\
+({						\
+	cpumask_t __tmp__;			\
+	cpus_and(__tmp__, map, cpu_online_map);	\
+	__tmp__ ? first_cpu(__tmp__) : NR_CPUS;	\
+})
 
 #define CPU_MASK_ALL	(~((cpumask_t)0) >> (8*sizeof(cpumask_t) - NR_CPUS))
 #define CPU_MASK_NONE	((cpumask_t)0)
===== include/asm-generic/cpumask_array.h 1.1 vs edited =====
--- 1.1/include/asm-generic/cpumask_array.h	Mon Aug 18 19:46:23 2003
+++ edited/include/asm-generic/cpumask_array.h	Wed Sep 10 23:46:05 2003
@@ -36,7 +36,13 @@
 					cpu_set(cpu, __cpu_mask);	\
 					__cpu_mask;			\
 				})
-#define any_online_cpu(map)	find_first_bit((map).mask, NR_CPUS)
+#define any_online_cpu(map)			\
+({						\
+	cpumask_t __tmp__;			\
+	cpus_and(__tmp__, map, cpu_online_map);	\
+	find_first_bit(__tmp__.mask, NR_CPUS);	\
+})
+
 
 /*
  * um, these need to be usable as static initializers
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"aart@kvack.org"> aart@kvack.org </a>

  parent reply	other threads:[~2003-09-11  6:53 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-09  6:50 2.6.0-test5-mm1 Andrew Morton
2003-09-09  7:02 ` 2.6.0-test5-mm1 Joshua Kwan
2003-09-09 21:57   ` 2.6.0-test5-mm1 Cliff White
2003-09-09  7:53 ` 2.6.0-test5-mm1 Jeremy Fitzhardinge
2003-09-10 19:59 ` 2.6.0-test5-mm1 usb keyboard prob Jonathan Brown
2003-09-10 21:17 ` 2.6.0-test5-mm1 Wiktor Wodecki
2003-09-11  6:53 ` William Lee Irwin III [this message]
2003-09-10 23:01 2.6.0-test5-mm1 Nakajima, Jun
2003-09-11  7:23 ` 2.6.0-test5-mm1 Wiktor Wodecki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030911065359.GS4306@holomorphy.com \
    --to=wli@holomorphy.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox