[PATCH] ipconfig : put root_server_path into __initdata section

2015-05-10 Thread tyeon

root_server_path is used only for the __init function.
so, no need to keep this variable in the memory after kernel init.

Signed-off-by: Tom(JeHyeon) Yeon 
---
 net/ipv4/ipconfig.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c
index b26376e..0f1b159 100644
--- a/net/ipv4/ipconfig.c
+++ b/net/ipv4/ipconfig.c
@@ -141,7 +141,7 @@ __be32 ic_addrservaddr = NONE;	/* IP Address of the 
IP addresses'server */

 __be32 ic_servaddr = NONE; /* Boot server IP address */

 __be32 root_server_addr = NONE;/* Address of NFS server */
-u8 root_server_path[256] = { 0, }; /* Path to mount as root */
+u8 root_server_path[256] __initdata = { 0, };  /* Path to mount as root */

 /* vendor class identifier */
 static char vendor_class_identifier[253] __initdata;
--
1.7.9.5
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] sysrq : restore console_loglevel back to orig_log_level

2015-05-06 Thread tyeon

if check_mask is true and sysrq_on_maks returns false,
then, the code go through the 'else' statement.
if (!check_mask || sysrq_on_maks(..)) {
...
} else {
pr_cont("This sysrq operation is disabled.\n");
}
...
So, console_loglevel remains CONSOLE_LOGLEVEL_DEFAULT

Signed-off-by: Tom(JeHyeon) Yeon 
---
 drivers/tty/sysrq.c |1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/tty/sysrq.c b/drivers/tty/sysrq.c
index 259a4d5..68d5295 100644
--- a/drivers/tty/sysrq.c
+++ b/drivers/tty/sysrq.c
@@ -537,6 +537,7 @@ void __handle_sysrq(int key, bool check_mask)
op_p->handler(key);
} else {
pr_cont("This sysrq operation is disabled.\n");
+   console_loglevel = orig_log_level;
}
} else {
pr_cont("HELP : ");
--
1.7.9.5

sorry to bother you.

if check_mask is true and sysrq_on_maks returns false,
then, the code go through the 'else' statement.
 if (!check_mask || sysrq_on_maks(..)) {
 ...
 } else {
 pr_cont("This sysrq operation is disabled.\n");
 }
 ...
So, console_loglevel remains CONSOLE_LOGLEVEL_DEFAULT

Signed-off-by: Tom(JeHyeon) Yeon 
---
  drivers/tty/sysrq.c |1 +
  1 file changed, 1 insertion(+)

diff --git a/drivers/tty/sysrq.c b/drivers/tty/sysrq.c
index 259a4d5..68d5295 100644
--- a/drivers/tty/sysrq.c
+++ b/drivers/tty/sysrq.c
@@ -537,6 +537,7 @@ void __handle_sysrq(int key, bool check_mask)
  op_p->handler(key);
  } else {
  pr_cont("This sysrq operation is disabled.\n");
+console_loglevel = orig_log_level;
  }
  } else {
  pr_cont("HELP : ");


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] PM / Hiberante : optimize swsusp_free()

2015-04-14 Thread tyeon

On Saturday, April 11, 2015 09:20 AM Rafael J. Wysocki worte:

On Wednesday, March 25, 2015 01:49:36 AM Yeon, JeHyeon wrote:

 From 6cb5fffc41911a29212be52d4ce7e481f5077ccf Mon Sep 17 00:00:00 2001
From: "Tom(JeHyeon) Yeon" 
Date: Thu, 19 Mar 2015 17:10:45 +0900
Subject: [PATCH] PM / Hiberante : optimize swsusp_free()

Our team developed the snapshot booting.
Fisrt of all, make a snapshot image, compress it and finally save it
in the storage(like mmc).
When the system is booting next time, bootloader read it from mmc,
decompress it and jump to the kernel.
In this circumstance, mili seconds is very important.
So, I prepared this patch, but not applied because I missed the time
to apply it.

And, I came across to find commit fdd64ed.
It's very similar to the patch I prepared.


So the part of the changelog above this line is not really relevant.

But the below is OK.

Ok, I'll get rid of the upper changelog.



I think do { ... } while (fb_pfn != fr_pfn) operation is very similar
to my patch. but, it takes a little more time to iterate.
So suggest to iterate one of two maps and check whether the other map
has the same pfn, finally free the page.

Signed-off-by: Tom(JeHyeon) Yeon 


As for the patch itself ->


---
  kernel/power/snapshot.c |   43 ++-
  1 file changed, 10 insertions(+), 33 deletions(-)

diff --git a/kernel/power/snapshot.c b/kernel/power/snapshot.c
index c24d5a2..a1ad801 100644
--- a/kernel/power/snapshot.c
+++ b/kernel/power/snapshot.c
@@ -726,14 +726,6 @@ static void memory_bm_clear_bit(struct memory_bitmap *bm, 
unsigned long pfn)
clear_bit(bit, addr);
  }

-static void memory_bm_clear_current(struct memory_bitmap *bm)
-{
-   int bit;
-
-   bit = max(bm->cur.node_bit - 1, 0);
-   clear_bit(bit, bm->cur.node->data);
-}
-
  static int memory_bm_test_bit(struct memory_bitmap *bm, unsigned long pfn)
  {
void *addr;
@@ -1342,36 +1334,21 @@ static struct memory_bitmap copy_bm;

  void swsusp_free(void)
  {
-   unsigned long fb_pfn, fr_pfn;
+   unsigned long pfn;

if (!forbidden_pages_map || !free_pages_map)
goto out;

memory_bm_position_reset(forbidden_pages_map);
-   memory_bm_position_reset(free_pages_map);
-
-loop:
-   fr_pfn = memory_bm_next_pfn(free_pages_map);
-   fb_pfn = memory_bm_next_pfn(forbidden_pages_map);
-
-   /*
-* Find the next bit set in both bitmaps. This is guaranteed to
-* terminate when fb_pfn == fr_pfn == BM_END_OF_MAP.
-*/
-   do {
-   if (fb_pfn < fr_pfn)
-   fb_pfn = memory_bm_next_pfn(forbidden_pages_map);
-   if (fr_pfn < fb_pfn)
-   fr_pfn = memory_bm_next_pfn(free_pages_map);
-   } while (fb_pfn != fr_pfn);
-
-   if (fr_pfn != BM_END_OF_MAP && pfn_valid(fr_pfn)) {
-   struct page *page = pfn_to_page(fr_pfn);
-
-   memory_bm_clear_current(forbidden_pages_map);
-   memory_bm_clear_current(free_pages_map);
-   __free_page(page);
-   goto loop;
+   for ( ; ; ) {
+   pfn  = memory_bm_next_pfn(forbidden_pages_map);
+   if (BM_END_OF_MAP == pfn)


-> First, the usual way of writing such things is

if (pfn == BM_END_OF_MAP)

(ie. the variable on the left-hand side of the operator).

Is there any rules for this this in kernel?
Sometime, human makes a mistake like "if (pfn = BM_END_OF_MAP)"
that's why I wrote like that even though the compiler may notice about it.


Second, don't you need to do the pfn_valid() check here too?
hmm. I can add pfn_valid() check. but I don't think that pfn_valid() 
should be checked in this stage.

I think forbidden_pages_map & free_pages_map should be always valid.
Is there any possibility those are not valid in this stage?



+   break;
+   if (memory_bm_test_bit(free_pages_map, pfn)) {
+   memory_bm_clear_bit(forbidden_pages_map, pfn);
+   memory_bm_clear_bit(free_pages_map, pfn);
+   __free_page(pfn_to_page(pfn));
+   }
}

  out:





thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/