* [KJ PATCH] Replacing memset(<addr>,0,PAGE_SIZE) with clear_page() in kernel/kexec.c 2007-05-08 10:45 ` [KJ PATCH] Replacing memset(<addr>,0,PAGE_SIZE) with clear_page() in mm/memory.c Shani Moideen @ 2007-05-08 11:02 ` Shani Moideen -1 siblings, 0 replies; 25+ messages in thread From: Shani Moideen @ 2007-05-08 10:50 UTC (permalink / raw) To: ebiederm; +Cc: linux-kernel, kernel-janitors Hi, Replacing memset(<addr>,0,PAGE_SIZE) with clear_page() in kernel/kexec.c Signed-off-by: Shani Moideen <shani.moideen@wipro.com> ---- thanks. diff --git a/kernel/kexec.c b/kernel/kexec.c index 2a59c8a..1a1afdd 100644 --- a/kernel/kexec.c +++ b/kernel/kexec.c @@ -787,7 +787,7 @@ static int kimage_load_normal_segment(struct kimage *image, ptr = kmap(page); /* Start with a clear page */ - memset(ptr, 0, PAGE_SIZE); + clear_page(ptr); ptr += maddr & ~PAGE_MASK; mchunk = PAGE_SIZE - (maddr & ~PAGE_MASK); if (mchunk > mbytes) -- Shani ^ permalink raw reply related [flat|nested] 25+ messages in thread
* [KJ] [KJ PATCH] Replacing memset(<addr>, 0, @ 2007-05-08 11:02 ` Shani Moideen 0 siblings, 0 replies; 25+ messages in thread From: Shani Moideen @ 2007-05-08 11:02 UTC (permalink / raw) To: ebiederm; +Cc: linux-kernel, kernel-janitors Hi, Replacing memset(<addr>,0,PAGE_SIZE) with clear_page() in kernel/kexec.c Signed-off-by: Shani Moideen <shani.moideen@wipro.com> ---- thanks. diff --git a/kernel/kexec.c b/kernel/kexec.c index 2a59c8a..1a1afdd 100644 --- a/kernel/kexec.c +++ b/kernel/kexec.c @@ -787,7 +787,7 @@ static int kimage_load_normal_segment(struct kimage *image, ptr = kmap(page); /* Start with a clear page */ - memset(ptr, 0, PAGE_SIZE); + clear_page(ptr); ptr += maddr & ~PAGE_MASK; mchunk = PAGE_SIZE - (maddr & ~PAGE_MASK); if (mchunk > mbytes) -- Shani _______________________________________________ Kernel-janitors mailing list Kernel-janitors@lists.linux-foundation.org https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors ^ permalink raw reply related [flat|nested] 25+ messages in thread
* [KJ] Re: [KJ PATCH] Replacing memset(<addr>, 0, 2007-05-08 11:02 ` [KJ] [KJ PATCH] Replacing memset(<addr>, 0, Shani Moideen @ 2007-05-08 11:10 ` Michael Tokarev -1 siblings, 0 replies; 25+ messages in thread From: Michael Tokarev @ 2007-05-08 11:10 UTC (permalink / raw) To: Shani Moideen; +Cc: ebiederm, linux-kernel, kernel-janitors Shani Moideen wrote: > ptr = kmap(page); > - memset(ptr, 0, PAGE_SIZE); > + clear_page(ptr); I wonder if it's worth to invent kzmap() or something like that... ;) /mjt _______________________________________________ Kernel-janitors mailing list Kernel-janitors@lists.linux-foundation.org https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors ^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [KJ PATCH] Replacing memset(<addr>,0,PAGE_SIZE) with clear_page() in kernel/kexec.c @ 2007-05-08 11:10 ` Michael Tokarev 0 siblings, 0 replies; 25+ messages in thread From: Michael Tokarev @ 2007-05-08 11:10 UTC (permalink / raw) To: Shani Moideen; +Cc: ebiederm, linux-kernel, kernel-janitors Shani Moideen wrote: > ptr = kmap(page); > - memset(ptr, 0, PAGE_SIZE); > + clear_page(ptr); I wonder if it's worth to invent kzmap() or something like that... ;) /mjt ^ permalink raw reply [flat|nested] 25+ messages in thread
* [KJ] Re: [KJ PATCH] Replacing memset(<addr>, 0, 2007-05-08 11:10 ` [KJ PATCH] Replacing memset(<addr>,0,PAGE_SIZE) with clear_page() in kernel/kexec.c Michael Tokarev @ 2007-05-08 12:21 ` Pekka Enberg -1 siblings, 0 replies; 25+ messages in thread From: Pekka Enberg @ 2007-05-08 12:21 UTC (permalink / raw) To: Michael Tokarev; +Cc: Shani Moideen, ebiederm, linux-kernel, kernel-janitors Shani Moideen wrote: > > ptr = kmap(page); > > - memset(ptr, 0, PAGE_SIZE); > > + clear_page(ptr); On 5/8/07, Michael Tokarev <mjt@tls.msk.ru> wrote: > I wonder if it's worth to invent kzmap() or something like that... ;) I am counting 59 kmap + memset pairs in the kernel, so perhaps it is worth it to reduce kernel text size. _______________________________________________ Kernel-janitors mailing list Kernel-janitors@lists.linux-foundation.org https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors ^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [KJ PATCH] Replacing memset(<addr>,0,PAGE_SIZE) with clear_page() in kernel/kexec.c @ 2007-05-08 12:21 ` Pekka Enberg 0 siblings, 0 replies; 25+ messages in thread From: Pekka Enberg @ 2007-05-08 12:21 UTC (permalink / raw) To: Michael Tokarev; +Cc: Shani Moideen, ebiederm, linux-kernel, kernel-janitors Shani Moideen wrote: > > ptr = kmap(page); > > - memset(ptr, 0, PAGE_SIZE); > > + clear_page(ptr); On 5/8/07, Michael Tokarev <mjt@tls.msk.ru> wrote: > I wonder if it's worth to invent kzmap() or something like that... ;) I am counting 59 kmap + memset pairs in the kernel, so perhaps it is worth it to reduce kernel text size. ^ permalink raw reply [flat|nested] 25+ messages in thread
* [KJ] Re: [KJ PATCH] Replacing memset(<addr>, 0, 2007-05-08 12:21 ` [KJ PATCH] Replacing memset(<addr>,0,PAGE_SIZE) with clear_page() in kernel/kexec.c Pekka Enberg @ 2007-05-08 17:13 ` Satyam Sharma -1 siblings, 0 replies; 25+ messages in thread From: Satyam Sharma @ 2007-05-08 17:13 UTC (permalink / raw) To: Pekka Enberg Cc: Michael Tokarev, Shani Moideen, ebiederm, linux-kernel, kernel-janitors On 5/8/07, Pekka Enberg <penberg@cs.helsinki.fi> wrote: > Shani Moideen wrote: > > > ptr = kmap(page); > > > - memset(ptr, 0, PAGE_SIZE); > > > + clear_page(ptr); > > On 5/8/07, Michael Tokarev <mjt@tls.msk.ru> wrote: > > I wonder if it's worth to invent kzmap() or something like that... ;) > > I am counting 59 kmap + memset pairs in the kernel, so perhaps it is > worth it to reduce kernel text size. Stuff of the sort already exists. Look for clear_highpage(), clear_user_highpage() and memclear_highpage_flush (recently renamed to zero_user_page, see -mm). But they all use kmap_atomic() -- kmap() variants would have to be added. Also, they're all inlines, so I'm not sure you'd be able to cut down text size, but still getting rid of open-coding is always good. _______________________________________________ Kernel-janitors mailing list Kernel-janitors@lists.linux-foundation.org https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors ^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [KJ PATCH] Replacing memset(<addr>,0,PAGE_SIZE) with clear_page() in kernel/kexec.c @ 2007-05-08 17:13 ` Satyam Sharma 0 siblings, 0 replies; 25+ messages in thread From: Satyam Sharma @ 2007-05-08 17:13 UTC (permalink / raw) To: Pekka Enberg Cc: Michael Tokarev, Shani Moideen, ebiederm, linux-kernel, kernel-janitors On 5/8/07, Pekka Enberg <penberg@cs.helsinki.fi> wrote: > Shani Moideen wrote: > > > ptr = kmap(page); > > > - memset(ptr, 0, PAGE_SIZE); > > > + clear_page(ptr); > > On 5/8/07, Michael Tokarev <mjt@tls.msk.ru> wrote: > > I wonder if it's worth to invent kzmap() or something like that... ;) > > I am counting 59 kmap + memset pairs in the kernel, so perhaps it is > worth it to reduce kernel text size. Stuff of the sort already exists. Look for clear_highpage(), clear_user_highpage() and memclear_highpage_flush (recently renamed to zero_user_page, see -mm). But they all use kmap_atomic() -- kmap() variants would have to be added. Also, they're all inlines, so I'm not sure you'd be able to cut down text size, but still getting rid of open-coding is always good. ^ permalink raw reply [flat|nested] 25+ messages in thread
* [KJ] Re: [KJ PATCH] Replacing memset(<addr>, 0, 2007-05-08 17:13 ` [KJ PATCH] Replacing memset(<addr>,0,PAGE_SIZE) with clear_page() in kernel/kexec.c Satyam Sharma @ 2007-05-08 17:40 ` Eric W. Biederman -1 siblings, 0 replies; 25+ messages in thread From: Eric W. Biederman @ 2007-05-08 17:40 UTC (permalink / raw) To: Satyam Sharma Cc: Pekka Enberg, Michael Tokarev, Shani Moideen, ebiederm, linux-kernel, kernel-janitors "Satyam Sharma" <satyam.sharma@gmail.com> writes: > On 5/8/07, Pekka Enberg <penberg@cs.helsinki.fi> wrote: >> Shani Moideen wrote: >> > > ptr = kmap(page); >> > > - memset(ptr, 0, PAGE_SIZE); >> > > + clear_page(ptr); >> >> On 5/8/07, Michael Tokarev <mjt@tls.msk.ru> wrote: >> > I wonder if it's worth to invent kzmap() or something like that... ;) >> >> I am counting 59 kmap + memset pairs in the kernel, so perhaps it is >> worth it to reduce kernel text size. > > Stuff of the sort already exists. Look for clear_highpage(), > clear_user_highpage() and memclear_highpage_flush (recently renamed to > zero_user_page, see -mm). But they all use kmap_atomic() -- kmap() > variants would have to be added. Also, they're all inlines, so I'm not > sure you'd be able to cut down text size, but still getting rid of > open-coding is always good. In this instance a clear_page variant should be ok. The combined variants are likely not because I use the mapping after it is cleared. Eric _______________________________________________ Kernel-janitors mailing list Kernel-janitors@lists.linux-foundation.org https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors ^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [KJ PATCH] Replacing memset(<addr>,0,PAGE_SIZE) with clear_page() in kernel/kexec.c @ 2007-05-08 17:40 ` Eric W. Biederman 0 siblings, 0 replies; 25+ messages in thread From: Eric W. Biederman @ 2007-05-08 17:40 UTC (permalink / raw) To: Satyam Sharma Cc: Pekka Enberg, Michael Tokarev, Shani Moideen, ebiederm, linux-kernel, kernel-janitors "Satyam Sharma" <satyam.sharma@gmail.com> writes: > On 5/8/07, Pekka Enberg <penberg@cs.helsinki.fi> wrote: >> Shani Moideen wrote: >> > > ptr = kmap(page); >> > > - memset(ptr, 0, PAGE_SIZE); >> > > + clear_page(ptr); >> >> On 5/8/07, Michael Tokarev <mjt@tls.msk.ru> wrote: >> > I wonder if it's worth to invent kzmap() or something like that... ;) >> >> I am counting 59 kmap + memset pairs in the kernel, so perhaps it is >> worth it to reduce kernel text size. > > Stuff of the sort already exists. Look for clear_highpage(), > clear_user_highpage() and memclear_highpage_flush (recently renamed to > zero_user_page, see -mm). But they all use kmap_atomic() -- kmap() > variants would have to be added. Also, they're all inlines, so I'm not > sure you'd be able to cut down text size, but still getting rid of > open-coding is always good. In this instance a clear_page variant should be ok. The combined variants are likely not because I use the mapping after it is cleared. Eric ^ permalink raw reply [flat|nested] 25+ messages in thread
* [KJ] Re: [KJ PATCH] Replacing memset(<addr>, 0, 2007-05-08 11:10 ` [KJ PATCH] Replacing memset(<addr>,0,PAGE_SIZE) with clear_page() in kernel/kexec.c Michael Tokarev (?) (?) @ 2007-06-18 12:51 ` QLogic Support -1 siblings, 0 replies; 25+ messages in thread From: QLogic Support @ 2007-06-18 12:51 UTC (permalink / raw) To: kernel-janitors [-- Attachment #1.1: Type: text/plain, Size: 1910 bytes --] Regards, Steve Newberger QLogic Corporation Support@QLogic.com Please visit our web @ http://support.qlogic.com/ ---- Original Message ---- From: shani.moideen@wipro.com Sent: 17-Jun-2007 22:33:56 To: support@pathscale.com Cc: openib-general@openib.org; kernel-janitors@lists.osdl.org Subject: [KJ PATCH] Replacing memset(<addr>,0,PAGE_SIZE) with clear_page(<addr>) in drivers/infiniband/hw/ipath/ipath_driver.c Replacing memset(<addr>,0,PAGE_SIZE) with clear_page(<addr>) in drivers/infiniband/hw/ipath/ipath_driver.c Signed-off-by: Shani Moideen <shani.moideen@wipro.com> ---- diff --git a/drivers/infiniband/hw/ipath/ipath_driver.c b/drivers/infiniband/hw/ipath/ipath_driver.c index e3a2232..417e3ca 100644 --- a/drivers/infiniband/hw/ipath/ipath_driver.c +++ b/drivers/infiniband/hw/ipath/ipath_driver.c @@ -1509,7 +1509,7 @@ int ipath_create_rcvhdrq(struct ipath_devdata *dd, /* clear for security and sanity on each use */ memset(pd->port_rcvhdrq, 0, pd->port_rcvhdrq_size); - memset(pd->port_rcvhdrtail_kvaddr, 0, PAGE_SIZE); + clear_page(pd->port_rcvhdrtail_kvaddr); /* * tell chip each time we init it, even if we are re-using previous -- Shani The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. www.wipro.com [-- Attachment #2: Type: text/plain, Size: 187 bytes --] _______________________________________________ Kernel-janitors mailing list Kernel-janitors@lists.linux-foundation.org https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors ^ permalink raw reply related [flat|nested] 25+ messages in thread
* [KJ] Re: [KJ PATCH] Replacing memset(<addr>, 0, 2007-05-08 11:10 ` [KJ PATCH] Replacing memset(<addr>,0,PAGE_SIZE) with clear_page() in kernel/kexec.c Michael Tokarev ` (2 preceding siblings ...) (?) @ 2007-07-10 19:28 ` Roland Dreier -1 siblings, 0 replies; 25+ messages in thread From: Roland Dreier @ 2007-07-10 19:28 UTC (permalink / raw) To: kernel-janitors thanks, I applied both mthca patches as one commit. _______________________________________________ REMINDER: this mailing list moved to vger.kernel.org and current one will be discontinued soon. To resubscribe, send email to majordomo@vger.kernel.org with "subscribe kernel-janitors" in message body and follow instructions. Kernel-janitors mailing list Kernel-janitors@lists.linux-foundation.org https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors ^ permalink raw reply [flat|nested] 25+ messages in thread
* [KJ PATCH] Replacing memset(<addr>,0,PAGE_SIZE) with clear_page() in mm/memory.c @ 2007-05-08 10:45 ` Shani Moideen 0 siblings, 0 replies; 25+ messages in thread From: Shani Moideen @ 2007-05-08 10:45 UTC (permalink / raw) To: linux-mm; +Cc: linux-kernel, kernel-janitors Hi, Replacing memset(<addr>,0,PAGE_SIZE) with clear_page() in mm/memory.c. Signed-off-by: Shani Moideen <shani.moideen@wipro.com> ---- thanks. diff --git a/mm/memory.c b/mm/memory.c index e7066e7..2780d07 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -1505,7 +1505,7 @@ static inline void cow_user_page(struct page *dst, struct page *src, unsigned lo * zeroes. */ if (__copy_from_user_inatomic(kaddr, uaddr, PAGE_SIZE)) - memset(kaddr, 0, PAGE_SIZE); + clear_page(kaddr); kunmap_atomic(kaddr, KM_USER0); flush_dcache_page(dst); return; -- Shani ^ permalink raw reply related [flat|nested] 25+ messages in thread
* [KJ] [KJ PATCH] Replacing memset(<addr>, 0, @ 2007-05-08 10:45 ` Shani Moideen 0 siblings, 0 replies; 25+ messages in thread From: Shani Moideen @ 2007-05-08 10:57 UTC (permalink / raw) To: linux-mm; +Cc: linux-kernel, kernel-janitors Hi, Replacing memset(<addr>,0,PAGE_SIZE) with clear_page() in mm/memory.c. Signed-off-by: Shani Moideen <shani.moideen@wipro.com> ---- thanks. diff --git a/mm/memory.c b/mm/memory.c index e7066e7..2780d07 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -1505,7 +1505,7 @@ static inline void cow_user_page(struct page *dst, struct page *src, unsigned lo * zeroes. */ if (__copy_from_user_inatomic(kaddr, uaddr, PAGE_SIZE)) - memset(kaddr, 0, PAGE_SIZE); + clear_page(kaddr); kunmap_atomic(kaddr, KM_USER0); flush_dcache_page(dst); return; -- Shani _______________________________________________ Kernel-janitors mailing list Kernel-janitors@lists.linux-foundation.org https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors ^ permalink raw reply related [flat|nested] 25+ messages in thread
* [KJ PATCH] Replacing memset(<addr>,0,PAGE_SIZE) with clear_page() in mm/memory.c @ 2007-05-08 10:45 ` Shani Moideen 0 siblings, 0 replies; 25+ messages in thread From: Shani Moideen @ 2007-05-08 10:45 UTC (permalink / raw) To: linux-mm; +Cc: linux-kernel, kernel-janitors Hi, Replacing memset(<addr>,0,PAGE_SIZE) with clear_page() in mm/memory.c. Signed-off-by: Shani Moideen <shani.moideen@wipro.com> ---- thanks. diff --git a/mm/memory.c b/mm/memory.c index e7066e7..2780d07 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -1505,7 +1505,7 @@ static inline void cow_user_page(struct page *dst, struct page *src, unsigned lo * zeroes. */ if (__copy_from_user_inatomic(kaddr, uaddr, PAGE_SIZE)) - memset(kaddr, 0, PAGE_SIZE); + clear_page(kaddr); kunmap_atomic(kaddr, KM_USER0); flush_dcache_page(dst); return; -- Shani -- 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:"dont@kvack.org"> email@kvack.org </a> ^ permalink raw reply related [flat|nested] 25+ messages in thread
* [KJ] Re: [KJ PATCH] Replacing memset(<addr>, 0, 2007-05-08 10:45 ` [KJ PATCH] Replacing memset(<addr>,0,PAGE_SIZE) with clear_page() in mm/memory.c Shani Moideen (?) @ 2007-05-08 11:18 ` Andy Whitcroft -1 siblings, 0 replies; 25+ messages in thread From: Andy Whitcroft @ 2007-05-08 11:18 UTC (permalink / raw) To: Shani Moideen; +Cc: linux-mm, linux-kernel, kernel-janitors Shani Moideen wrote: > Hi, > > Replacing memset(<addr>,0,PAGE_SIZE) with clear_page() in mm/memory.c. > > Signed-off-by: Shani Moideen <shani.moideen@wipro.com> > ---- > > thanks. > > > diff --git a/mm/memory.c b/mm/memory.c > index e7066e7..2780d07 100644 > --- a/mm/memory.c > +++ b/mm/memory.c > @@ -1505,7 +1505,7 @@ static inline void cow_user_page(struct page *dst, struct page *src, unsigned lo > * zeroes. > */ > if (__copy_from_user_inatomic(kaddr, uaddr, PAGE_SIZE)) > - memset(kaddr, 0, PAGE_SIZE); > + clear_page(kaddr); > kunmap_atomic(kaddr, KM_USER0); > flush_dcache_page(dst); > return; > > This looks to be whitespace dammaged? -apw use tabs not spaces PATCH: -:64: FILE: b/mm/memory.c:1508: + clear_page(kaddr);$ _______________________________________________ Kernel-janitors mailing list Kernel-janitors@lists.linux-foundation.org https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors ^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [KJ PATCH] Replacing memset(<addr>,0,PAGE_SIZE) with clear_page() in mm/memory.c @ 2007-05-08 11:18 ` Andy Whitcroft 0 siblings, 0 replies; 25+ messages in thread From: Andy Whitcroft @ 2007-05-08 11:18 UTC (permalink / raw) To: Shani Moideen; +Cc: linux-mm, linux-kernel, kernel-janitors Shani Moideen wrote: > Hi, > > Replacing memset(<addr>,0,PAGE_SIZE) with clear_page() in mm/memory.c. > > Signed-off-by: Shani Moideen <shani.moideen@wipro.com> > ---- > > thanks. > > > diff --git a/mm/memory.c b/mm/memory.c > index e7066e7..2780d07 100644 > --- a/mm/memory.c > +++ b/mm/memory.c > @@ -1505,7 +1505,7 @@ static inline void cow_user_page(struct page *dst, struct page *src, unsigned lo > * zeroes. > */ > if (__copy_from_user_inatomic(kaddr, uaddr, PAGE_SIZE)) > - memset(kaddr, 0, PAGE_SIZE); > + clear_page(kaddr); > kunmap_atomic(kaddr, KM_USER0); > flush_dcache_page(dst); > return; > > This looks to be whitespace dammaged? -apw use tabs not spaces PATCH: -:64: FILE: b/mm/memory.c:1508: + clear_page(kaddr);$ -- 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:"dont@kvack.org"> email@kvack.org </a> ^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [KJ PATCH] Replacing memset(<addr>,0,PAGE_SIZE) with clear_page() in mm/memory.c @ 2007-05-08 11:18 ` Andy Whitcroft 0 siblings, 0 replies; 25+ messages in thread From: Andy Whitcroft @ 2007-05-08 11:18 UTC (permalink / raw) To: Shani Moideen; +Cc: linux-mm, linux-kernel, kernel-janitors Shani Moideen wrote: > Hi, > > Replacing memset(<addr>,0,PAGE_SIZE) with clear_page() in mm/memory.c. > > Signed-off-by: Shani Moideen <shani.moideen@wipro.com> > ---- > > thanks. > > > diff --git a/mm/memory.c b/mm/memory.c > index e7066e7..2780d07 100644 > --- a/mm/memory.c > +++ b/mm/memory.c > @@ -1505,7 +1505,7 @@ static inline void cow_user_page(struct page *dst, struct page *src, unsigned lo > * zeroes. > */ > if (__copy_from_user_inatomic(kaddr, uaddr, PAGE_SIZE)) > - memset(kaddr, 0, PAGE_SIZE); > + clear_page(kaddr); > kunmap_atomic(kaddr, KM_USER0); > flush_dcache_page(dst); > return; > > This looks to be whitespace dammaged? -apw use tabs not spaces PATCH: -:64: FILE: b/mm/memory.c:1508: + clear_page(kaddr);$ ^ permalink raw reply [flat|nested] 25+ messages in thread
* [KJ] [KJ PATCH] Replacing memset(<addr>,0,PAGE_SIZE) with 2007-05-08 10:45 ` [KJ PATCH] Replacing memset(<addr>,0,PAGE_SIZE) with clear_page() in mm/memory.c Shani Moideen ` (2 preceding siblings ...) (?) @ 2007-06-14 11:15 ` Shani Moideen -1 siblings, 0 replies; 25+ messages in thread From: Shani Moideen @ 2007-06-14 11:15 UTC (permalink / raw) To: kernel-janitors Replacing memset(<addr>,0,PAGE_SIZE) with clear_page(<addr>) in drivers/char/drm/i810_dma.c Signed-off-by: Shani Moideen <shani.moideen@wipro.com> ---- diff --git a/drivers/char/drm/i810_dma.c b/drivers/char/drm/i810_dma.c index 603d17f..4dbd97f 100644 --- a/drivers/char/drm/i810_dma.c +++ b/drivers/char/drm/i810_dma.c @@ -413,7 +413,7 @@ static int i810_dma_initialize(drm_device_t * dev, DRM_ERROR("Can not allocate hardware status page\n"); return -ENOMEM; } - memset(dev_priv->hw_status_page, 0, PAGE_SIZE); + clear_page(dev_priv->hw_status_page); DRM_DEBUG("hw status page @ %p\n", dev_priv->hw_status_page); I810_WRITE(0x02080, dev_priv->dma_status_page); -- Shani _______________________________________________ Kernel-janitors mailing list Kernel-janitors@lists.linux-foundation.org https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors ^ permalink raw reply related [flat|nested] 25+ messages in thread
* [KJ] [KJ PATCH] Replacing memset(<addr>,0,PAGE_SIZE) with 2007-05-08 10:45 ` [KJ PATCH] Replacing memset(<addr>,0,PAGE_SIZE) with clear_page() in mm/memory.c Shani Moideen ` (3 preceding siblings ...) (?) @ 2007-06-14 11:28 ` Shani Moideen -1 siblings, 0 replies; 25+ messages in thread From: Shani Moideen @ 2007-06-14 11:28 UTC (permalink / raw) To: kernel-janitors Replacing memset(<addr>,0,PAGE_SIZE) with clear_page(<addr>) in drivers/char/drm/i830_dma.c Signed-off-by: Shani Moideen <shani.moideen@wipro.com> ---- diff --git a/drivers/char/drm/i830_dma.c b/drivers/char/drm/i830_dma.c index 3314a9f..2b6632d 100644 --- a/drivers/char/drm/i830_dma.c +++ b/drivers/char/drm/i830_dma.c @@ -433,7 +433,7 @@ static int i830_dma_initialize(drm_device_t * dev, DRM_ERROR("Can not allocate hardware status page\n"); return -ENOMEM; } - memset(dev_priv->hw_status_page, 0, PAGE_SIZE); + clear_page(dev_priv->hw_status_page); DRM_DEBUG("hw status page @ %p\n", dev_priv->hw_status_page); I830_WRITE(0x02080, dev_priv->dma_status_page); -- Shani _______________________________________________ Kernel-janitors mailing list Kernel-janitors@lists.linux-foundation.org https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors ^ permalink raw reply related [flat|nested] 25+ messages in thread
* [KJ] [KJ PATCH] Replacing memset(<addr>,0,PAGE_SIZE) with 2007-05-08 10:45 ` [KJ PATCH] Replacing memset(<addr>,0,PAGE_SIZE) with clear_page() in mm/memory.c Shani Moideen ` (4 preceding siblings ...) (?) @ 2007-06-14 11:32 ` Shani Moideen -1 siblings, 0 replies; 25+ messages in thread From: Shani Moideen @ 2007-06-14 11:32 UTC (permalink / raw) To: kernel-janitors Replacing memset(<addr>,0,PAGE_SIZE) with clear_page(<addr>) in drivers/char/drm/i915_dma.c Signed-off-by: Shani Moideen <shani.moideen@wipro.com> ---- diff --git a/drivers/char/drm/i915_dma.c b/drivers/char/drm/i915_dma.c index 1ba15d9..4f17eb6 100644 --- a/drivers/char/drm/i915_dma.c +++ b/drivers/char/drm/i915_dma.c @@ -191,7 +191,7 @@ static int i915_initialize(drm_device_t * dev, dev_priv->hw_status_page = dev_priv->status_page_dmah->vaddr; dev_priv->dma_status_page = dev_priv->status_page_dmah->busaddr; - memset(dev_priv->hw_status_page, 0, PAGE_SIZE); + clear_page(dev_priv->hw_status_page); DRM_DEBUG("hw status page @ %p\n", dev_priv->hw_status_page); I915_WRITE(0x02080, dev_priv->dma_status_page); -- Shani _______________________________________________ Kernel-janitors mailing list Kernel-janitors@lists.linux-foundation.org https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors ^ permalink raw reply related [flat|nested] 25+ messages in thread
* [KJ] [KJ PATCH] Replacing memset(<addr>,0,PAGE_SIZE) with 2007-05-08 10:45 ` [KJ PATCH] Replacing memset(<addr>,0,PAGE_SIZE) with clear_page() in mm/memory.c Shani Moideen ` (5 preceding siblings ...) (?) @ 2007-06-18 3:28 ` Shani Moideen -1 siblings, 0 replies; 25+ messages in thread From: Shani Moideen @ 2007-06-18 3:28 UTC (permalink / raw) To: kernel-janitors Replacing memset(<addr>,0,PAGE_SIZE) with clear_page(<addr>) in drivers/infiniband/hw/mthca/mthca_allocator.c Signed-off-by: Shani Moideen <shani.moideen@wipro.com> ---- diff --git a/drivers/infiniband/hw/mthca/mthca_allocator.c b/drivers/infiniband/hw/mthca/mthca_allocator.c index f930e55..a763067 100644 --- a/drivers/infiniband/hw/mthca/mthca_allocator.c +++ b/drivers/infiniband/hw/mthca/mthca_allocator.c @@ -255,7 +255,7 @@ int mthca_buf_alloc(struct mthca_dev *dev, int size, int max_direct, dma_list[i] = t; pci_unmap_addr_set(&buf->page_list[i], mapping, t); - memset(buf->page_list[i].buf, 0, PAGE_SIZE); + clear_page(buf->page_list[i].buf); } } -- Shani _______________________________________________ Kernel-janitors mailing list Kernel-janitors@lists.linux-foundation.org https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors ^ permalink raw reply related [flat|nested] 25+ messages in thread
* [KJ] [KJ PATCH] Replacing memset(<addr>,0,PAGE_SIZE) with 2007-05-08 10:45 ` [KJ PATCH] Replacing memset(<addr>,0,PAGE_SIZE) with clear_page() in mm/memory.c Shani Moideen ` (6 preceding siblings ...) (?) @ 2007-06-18 3:35 ` Shani Moideen -1 siblings, 0 replies; 25+ messages in thread From: Shani Moideen @ 2007-06-18 3:35 UTC (permalink / raw) To: kernel-janitors Replacing memset(<addr>,0,PAGE_SIZE) with clear_page(<addr>) in drivers/infiniband/hw/mthca/mthca_eq.c Signed-off-by: Shani Moideen <shani.moideen@wipro.com> ---- diff --git a/drivers/infiniband/hw/mthca/mthca_eq.c b/drivers/infiniband/hw/mthca/mthca_eq.c index 8ec9fa1..8592b26 100644 --- a/drivers/infiniband/hw/mthca/mthca_eq.c +++ b/drivers/infiniband/hw/mthca/mthca_eq.c @@ -522,7 +522,7 @@ static int mthca_create_eq(struct mthca_dev *dev, dma_list[i] = t; pci_unmap_addr_set(&eq->page_list[i], mapping, t); - memset(eq->page_list[i].buf, 0, PAGE_SIZE); + clear_page(eq->page_list[i].buf); } for (i = 0; i < eq->nent; ++i) -- Shani _______________________________________________ Kernel-janitors mailing list Kernel-janitors@lists.linux-foundation.org https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors ^ permalink raw reply related [flat|nested] 25+ messages in thread
* [KJ] [KJ PATCH] Replacing memset(<addr>,0,PAGE_SIZE) with 2007-05-08 10:45 ` [KJ PATCH] Replacing memset(<addr>,0,PAGE_SIZE) with clear_page() in mm/memory.c Shani Moideen ` (7 preceding siblings ...) (?) @ 2007-06-18 3:45 ` Shani Moideen -1 siblings, 0 replies; 25+ messages in thread From: Shani Moideen @ 2007-06-18 3:45 UTC (permalink / raw) To: kernel-janitors Replacing memset(<addr>,0,PAGE_SIZE) with clear_page(<addr>) in drivers/infiniband/hw/ipath/ipath_driver.c Signed-off-by: Shani Moideen <shani.moideen@wipro.com> ---- diff --git a/drivers/infiniband/hw/ipath/ipath_driver.c b/drivers/infiniband/hw/ipath/ipath_driver.c index e3a2232..417e3ca 100644 --- a/drivers/infiniband/hw/ipath/ipath_driver.c +++ b/drivers/infiniband/hw/ipath/ipath_driver.c @@ -1509,7 +1509,7 @@ int ipath_create_rcvhdrq(struct ipath_devdata *dd, /* clear for security and sanity on each use */ memset(pd->port_rcvhdrq, 0, pd->port_rcvhdrq_size); - memset(pd->port_rcvhdrtail_kvaddr, 0, PAGE_SIZE); + clear_page(pd->port_rcvhdrtail_kvaddr); /* * tell chip each time we init it, even if we are re-using previous -- Shani _______________________________________________ Kernel-janitors mailing list Kernel-janitors@lists.linux-foundation.org https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors ^ permalink raw reply related [flat|nested] 25+ messages in thread
* Re: [KJ] [KJ PATCH] Replacing memset(<addr>,0,PAGE_SIZE) with 2007-05-08 10:45 ` [KJ PATCH] Replacing memset(<addr>,0,PAGE_SIZE) with clear_page() in mm/memory.c Shani Moideen ` (8 preceding siblings ...) (?) @ 2007-06-18 13:03 ` Robert P. J. Day -1 siblings, 0 replies; 25+ messages in thread From: Robert P. J. Day @ 2007-06-18 13:03 UTC (permalink / raw) To: kernel-janitors On Mon, 18 Jun 2007, Shani Moideen wrote: ... > - memset(buf->page_list[i].buf, 0, PAGE_SIZE); > + clear_page(buf->page_list[i].buf); ... i'm not sure whether this current cleanup project was at all inspired by the page at the wiki: http://fsdev.net/wiki/index.php?title=Clear_page_copy_page note that there are two sort of related cleanups -- clear_page() and copy_page(). but, as you can read there, it's not *entirely* clear that the clears or copies are entirely equivalent to the corresponding memset() or memcpy() calls (or whether they should be). calling memset() for a size of PAGE_SIZE doesn't necessarily mean that the address is on a page boundary, while it's possible that something called "clear_page()" is *meant* to work only on an actual page. that's not what appears to be happening, but it's something to keep in mind: *should* something called "clear_page()" have any extra semantics above and beyond just clearing something that's the size of a page? and the same thing can be asked of "copy_page()". i'm not saying that there's anything amiss with the current cleaning, and i'm happy to see it happening. i'm just curious as to whether the possible semantic ambiguity has been examined and dismissed. rday -- ==================================== Robert P. J. Day Linux Consulting, Training and Annoying Kernel Pedantry Waterloo, Ontario, CANADA http://fsdev.net/wiki/index.php?title=Main_Page ==================================== _______________________________________________ Kernel-janitors mailing list Kernel-janitors@lists.linux-foundation.org https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors ^ permalink raw reply [flat|nested] 25+ messages in thread
end of thread, other threads:[~2007-07-10 19:28 UTC | newest] Thread overview: 25+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2007-05-08 10:50 [KJ PATCH] Replacing memset(<addr>,0,PAGE_SIZE) with clear_page() in kernel/kexec.c Shani Moideen 2007-05-08 11:02 ` [KJ] [KJ PATCH] Replacing memset(<addr>, 0, Shani Moideen 2007-05-08 11:10 ` [KJ] " Michael Tokarev 2007-05-08 11:10 ` [KJ PATCH] Replacing memset(<addr>,0,PAGE_SIZE) with clear_page() in kernel/kexec.c Michael Tokarev 2007-05-08 12:21 ` [KJ] Re: [KJ PATCH] Replacing memset(<addr>, 0, Pekka Enberg 2007-05-08 12:21 ` [KJ PATCH] Replacing memset(<addr>,0,PAGE_SIZE) with clear_page() in kernel/kexec.c Pekka Enberg 2007-05-08 17:13 ` [KJ] Re: [KJ PATCH] Replacing memset(<addr>, 0, Satyam Sharma 2007-05-08 17:13 ` [KJ PATCH] Replacing memset(<addr>,0,PAGE_SIZE) with clear_page() in kernel/kexec.c Satyam Sharma 2007-05-08 17:40 ` [KJ] Re: [KJ PATCH] Replacing memset(<addr>, 0, Eric W. Biederman 2007-05-08 17:40 ` [KJ PATCH] Replacing memset(<addr>,0,PAGE_SIZE) with clear_page() in kernel/kexec.c Eric W. Biederman 2007-06-18 12:51 ` [KJ] Re: [KJ PATCH] Replacing memset(<addr>, 0, QLogic Support 2007-07-10 19:28 ` Roland Dreier -- strict thread matches above, loose matches on Subject: below -- 2007-05-08 10:45 [KJ PATCH] Replacing memset(<addr>,0,PAGE_SIZE) with clear_page() in mm/memory.c Shani Moideen 2007-05-08 10:57 ` [KJ] [KJ PATCH] Replacing memset(<addr>, 0, Shani Moideen 2007-05-08 10:45 ` [KJ PATCH] Replacing memset(<addr>,0,PAGE_SIZE) with clear_page() in mm/memory.c Shani Moideen 2007-05-08 11:18 ` [KJ] Re: [KJ PATCH] Replacing memset(<addr>, 0, Andy Whitcroft 2007-05-08 11:18 ` [KJ PATCH] Replacing memset(<addr>,0,PAGE_SIZE) with clear_page() in mm/memory.c Andy Whitcroft 2007-05-08 11:18 ` Andy Whitcroft 2007-06-14 11:15 ` [KJ] [KJ PATCH] Replacing memset(<addr>,0,PAGE_SIZE) with Shani Moideen 2007-06-14 11:28 ` Shani Moideen 2007-06-14 11:32 ` Shani Moideen 2007-06-18 3:28 ` Shani Moideen 2007-06-18 3:35 ` Shani Moideen 2007-06-18 3:45 ` Shani Moideen 2007-06-18 13:03 ` Robert P. J. Day
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.