Re: [PATCH] s390: fix invalid kmalloc flags

2005-08-05 Thread Andrew Morton
Benjamin LaHaise <[EMAIL PROTECTED]> wrote:
>
> On Fri, Aug 05, 2005 at 05:36:29PM -0700, Andrew Morton wrote:
> > No, GFP_DMA should work OK.  Except GFP_DMA doesn't have __GFP_VALID set. 
> > It's strange that this didn't get noticed earlier.
> > 
> > Ben, was there a reason for not giving GFP_DMA the treatment?
> 
> Not really.  Traditionally GFP_DMA was always mixed in with GFP_KERNEL or 
> GFP_ATOMIC.  It seems that GFP_DMA wasn't in the hunk of defines that all 
> the other kernel flags were in, so if GFP_DMA is really valid all by itself, 
> adding in the __GFP_VALID should be okay.
> 

OK, it seems that pretty much all callers do remember to add GFP_KERNEL so
I guess we can treat this as a bug-which-ben's-patch-found and merge
Benoit's fix.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] s390: fix invalid kmalloc flags

2005-08-05 Thread Benjamin LaHaise
On Fri, Aug 05, 2005 at 05:36:29PM -0700, Andrew Morton wrote:
> No, GFP_DMA should work OK.  Except GFP_DMA doesn't have __GFP_VALID set. 
> It's strange that this didn't get noticed earlier.
> 
> Ben, was there a reason for not giving GFP_DMA the treatment?

Not really.  Traditionally GFP_DMA was always mixed in with GFP_KERNEL or 
GFP_ATOMIC.  It seems that GFP_DMA wasn't in the hunk of defines that all 
the other kernel flags were in, so if GFP_DMA is really valid all by itself, 
adding in the __GFP_VALID should be okay.

-ben
-- 
"Time is what keeps everything from happening all at once." -- John Wheeler
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] s390: fix invalid kmalloc flags

2005-08-05 Thread Andrew Morton
[EMAIL PROTECTED] wrote:
>
> The following patch fixes the compilation (defconfig) of s390:
> 
>  arch/s390/mm/built-in.o(.text+0x152c): In function `query_segment_type':
>  extmem.c: undefined reference to `__your_kmalloc_flags_are_not_valid'
>  arch/s390/mm/built-in.o(.text+0x19ec): In function `segment_load':
>  : undefined reference to `__your_kmalloc_flags_are_not_valid'
> 
> 
>  Signed-off-by: Benoit Boissinot <[EMAIL PROTECTED]>
> 
>  --- a/arch/s390/mm/extmem.c  2005-08-06 01:32:56.0 +0200
>  +++ b/arch/s390/mm/extmem.c  2005-07-31 17:46:36.0 +0200
>  @@ -172,8 +172,8 @@ dcss_diag_translate_rc (int vm_rc) {
>   static int
>   query_segment_type (struct dcss_segment *seg)
>   {
>  -struct qin64  *qin = kmalloc (sizeof(struct qin64), GFP_DMA);
>  -struct qout64 *qout = kmalloc (sizeof(struct qout64), GFP_DMA);
>  +struct qin64  *qin = kmalloc (sizeof(struct qin64), GFP_DMA|GFP_KERNEL);
>  +struct qout64 *qout = kmalloc (sizeof(struct qout64), 
> GFP_DMA|GFP_KERNEL);

No, GFP_DMA should work OK.  Except GFP_DMA doesn't have __GFP_VALID set. 
It's strange that this didn't get noticed earlier.

Ben, was there a reason for not giving GFP_DMA the treatment?
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] s390: fix invalid kmalloc flags

2005-08-05 Thread benoit . boissinot
The following patch fixes the compilation (defconfig) of s390:

arch/s390/mm/built-in.o(.text+0x152c): In function `query_segment_type':
extmem.c: undefined reference to `__your_kmalloc_flags_are_not_valid'
arch/s390/mm/built-in.o(.text+0x19ec): In function `segment_load':
: undefined reference to `__your_kmalloc_flags_are_not_valid'


Signed-off-by: Benoit Boissinot <[EMAIL PROTECTED]>

--- a/arch/s390/mm/extmem.c 2005-08-06 01:32:56.0 +0200
+++ b/arch/s390/mm/extmem.c 2005-07-31 17:46:36.0 +0200
@@ -172,8 +172,8 @@ dcss_diag_translate_rc (int vm_rc) {
 static int
 query_segment_type (struct dcss_segment *seg)
 {
-   struct qin64  *qin = kmalloc (sizeof(struct qin64), GFP_DMA);
-   struct qout64 *qout = kmalloc (sizeof(struct qout64), GFP_DMA);
+   struct qin64  *qin = kmalloc (sizeof(struct qin64), GFP_DMA|GFP_KERNEL);
+   struct qout64 *qout = kmalloc (sizeof(struct qout64), 
GFP_DMA|GFP_KERNEL);
 
int diag_cc, rc, i;
unsigned long dummy, vmrc;
@@ -332,7 +332,7 @@ static int
 __segment_load (char *name, int do_nonshared, unsigned long *addr, unsigned 
long *end)
 {
struct dcss_segment *seg = kmalloc(sizeof(struct dcss_segment),
-   GFP_DMA);
+   GFP_DMA|GFP_KERNEL);
int dcss_command, rc, diag_cc;
 
if (seg == NULL) {
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/