10๋ถ ์์ ์ดํด๋ณด๋ VS Code โ Github or Mailing ๊ธฐ๋ฐ ์คํ์์ค ๊ธฐ์ฌํ๊ธฐ
์ธ์ง๊ธฐ์ ํ ๊น์ค์ฑ
git log
, ํน์ ์ปค๋ฐ์ ์์ ์ผ๋ก ๋ฐ๊พธ๋ git checkout
์ ๋์ํ๋ ๊ธฐ๋ฅ์ธ๋ฐ ์ง๊ด์ ์ผ๋ก ๋ณด๊ธฐ ํธํฉ๋๋ค.๊ตญ์ ์ ์ผ๋ก ๋ฉ์ผ๋ง ๊ธฐ๋ก์ด ๋จ๊ธฐ ๋๋ฌธ์,
๋ฉ์ธํ
์ด๋๋ค์ด ์ฌ์ํ ํจ์น๋ผ๋ ์ ์คํ๊ฒ ๋ฆฌ๋ทฐํด์ค๋๋ค.
ํนํ, Pull Request(ํจ์น)๋ฅผ ๋ณด๋ธ ๊ธฐ์ฌ์๋ฅผ ์ค๋ํ๊ธฐ ์ํด์
์ด๋ ค์ด ๋์์ ์์ธํ ์ค๋ช
ํด์ฃผ์ด ๋ง์ ๋์์ด ๋์์ต๋๋ค.
์ฝ๋ ์ ์ ๋ถ์๊ธฐ๋ก ๋์จ ํญ๋ชฉ ์ค์ Null ๊ด๋ จ ๋ณด์ ์ฌํญ์ ํ์ธํ ํ ํจ์น๋ฅผ ํด๋ด ๋๋ค.
cmds/graph.c:282: error: Null Dereference
pointer `graph` last assigned on line 279 could be null
and is dereferenced at line 282, column 3.
281. if (tg->utg.graph && tg->utg.graph != graph) {
282. pr_dbg("detect new session: %.*s\n", SESSION_ID_LEN, graph->sess->sid);
^
๊นํ๋ธ ์ด์๋ก ๋ฑ๋กํ ๋ค์ ํด๋น ์ฌํญ์ ๋ณด์ํ๋ ์์
์ ์งํํฉ๋๋ค.
์ปค๋ฐ์ ํ๊ณ ๋ ๋ค์ ๋ง์ง๋ง ์ปค๋ฐ ์คํ ์ทจ์๋ก ์ฝ๊ฒ ์คํ
์ด์ง ๋จ๊ณ๋ก ๋๋์ ์ฌ ์ ์์ต๋๋ค.
์ฝ๋๋ฆฌ๋ทฐ๋ฅผ ๋ฐ๊ณ ๋ณด์ํ ๋ถ๋ถ์ด ์๋ค๋ฉด, ํ์ฉํ๋ฉด ์ข์ต๋๋ค.
์ปค๋ฐํ๊ณ ํธ์ฌ๋ก origin ๋ธ๋์น์ ๋ฐ์๋์๋๋ฐ ๋ ์์ ์ด ํ์ํ๋ค๋ฉด?
์์ ์ปค๋ฐ์ origin์ ์ฌ๋ผ๊ฐ ๋ธ๋์น์ ์์ง ์๊ณ (๋ณดํต ์ปค๋ฐ ํ์คํ ๋ฆฌ ๊ด๋ฆฌํ๊ธฐ ๋๋ฌธ์ ์ข์ํ์ง ์์ต๋๋ค.) ๋ง์ง๋ง ์ปค๋ฐ์ ์์ ํ์ฌ git push -f
๋ก ๋ฎ์ด ์จ์ค๋๋ค.
fork ํ ๋ธ๋์น(Downstream)๋ฅผ origin(Upstream)์ ๋จธ์งํ ์ ์๋๋ก Pull Request ์ ์์ฑํ๋ ๋จ๊ณ์ ๋๋ค. Pull Request ๋ ๋น๊น์ ์์ฒญํ๋ค. ์ฆ, ์คํ์์ค ๋ฉ์ธํ ์ด๋์๊ฒ ๋ด ์์ค๋ฅผ ์ก์ ๋น๊ฒจ์ ๋ฃ์ผ๋ผ๋ ์๋ฏธ์ ๋๋ค.
์์ค ์ต์๋จ์ MAINTAINERS
์ฐธ๊ณ ํ์ฌ github ์ 1 ~ 2 ์ ์ ์ฌํ์ง๋ง, Pull Request๊ณผ ์ฝ๋ ๋ฆฌ๋ทฐ๋ฅผ ๋ชจ๋ ๋ด๋น์์ ๋ฉ์ผ๋ก ๋ณด๋
๋๋ค.
git send-email --smtp-pass="๋น๋ฐ๋ฒํธ" \
--to="๋ฉ์ธํ
์ด๋@์ด๋ฉ์ผ.์ฃผ์" \
--cc="์ฐธ์กฐํ @๋ฉ์ผ.์ฃผ์๋ค" \
--confirm=always -M -1
๋ค์ ์นด์ดํธ๋ ์์ ํ ์ปค๋ฐ ๊ฐ์๋ฅผ ๋ฃ์ต๋๋ค.
git send-email \
--to="Thomas Gleixner <tglx@linutronix.de>, Marc Zyngier <maz@kernel.org>"
--cc="linux-kernel@vger.kernel.org, Austin Kim <austindh.kim@gmail.com>"
--confirm=always -M -1
์ปค๋ฐ ๋ฉ์ธ์ง๋ฅผ ์์ฑํ ๋, ์์ด ์๋ฌธ ์ค๋ ฅ์ด ํ์ํ์ง๋ง,
์ฐ๋ฆฌ์๊ฒ ๊ตฌ๊ธ ๋ฒ์ญ๊ธฐ๊ฐ ์์ต๋๋ค.
Hello
Since we have a macro defined in our IRQ subsystem internal functions to
traverse the list of actions, how about refactoring this loop?
- genirq: Use a common macro to go through the actions list
(f944b5a7aff05a244a6c8cac297819af09a199e4)
have a good day!
---
kernel/irq/irqdesc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/irq/irqdesc.c b/kernel/irq/irqdesc.c
index 939d21cd55c3..34a0cefff712 100644
--- a/kernel/irq/irqdesc.c
+++ b/kernel/irq/irqdesc.c
@@ -246,12 +246,12 @@ static ssize_t actions_show(struct kobject *kobj,
struct kobj_attribute *attr, char *buf)
{
struct irq_desc *desc = container_of(kobj, struct irq_desc, kobj);
- struct irqaction *action;
+ struct irqaction *action = NULL;
ssize_t ret = 0;
char *p = "";
raw_spin_lock_irq(&desc->lock);
- for (action = desc->action; action != NULL; action = action->next) {
+ for_each_action_of_desc(desc, action) {
ret += scnprintf(buf + ret, PAGE_SIZE - ret, "%s%s",
p, action->name);
p = ",";
--
ํด๋น ์๋ธ์์คํ ์ ๋ฉ์ธํ ์ด๋๊ฐ ๋ณด๋ธ ํจ์น์ ๋ํด์ ๋ณด์ํด์ผํ ์ฌํญ์ ๋ฆฌ๋ทฐํด์ค๋๋ค.
Re: [PATCH] genirq: Refactor actions_show loop block using a common macro to go through the actions list
- by Thomas Gleixner @ 2022-04-10 19:17 UTC [7%]
On Fri, Apr 08 2022 at 20:41, you wrote:
thanks for providing this patch.
> Hello.
>
> Since we have a macro defined in our IRQ subsystem internal functions to
> traverse the list of actions, how about refactoring this loop?
>
> - genirq: Use a common macro to go through the actions list
> (f944b5a7aff05a244a6c8cac297819af09a199e4)
>
> have a good day!
Neither 'Hello' nor 'have a good day' are part of the change log.
Also please write the changelog in a factual way and not in form of a
question. If you want to add a reference to a git commit, then please
use the canonical form as described in Documentation/process, where you
also find the general patch submission rules. There is also a tip tree
specific chapter:
https://www.kernel.org/doc/html/latest/process/maintainer-tip.html?highlight=x86#patch-submission-notes
Following these rules makes everyones life simpler.
> ---
> kernel/irq/irqdesc.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/kernel/irq/irqdesc.c b/kernel/irq/irqdesc.c
> index 939d21cd55c3..34a0cefff712 100644
> --- a/kernel/irq/irqdesc.c
> +++ b/kernel/irq/irqdesc.c
> @@ -246,12 +246,12 @@ static ssize_t actions_show(struct kobject *kobj,
> struct kobj_attribute *attr, char *buf)
> {
> struct irq_desc *desc = container_of(kobj, struct irq_desc, kobj);
> - struct irqaction *action;
> + struct irqaction *action = NULL;
There is no NULL initialization required.
Thanks,
tglx
๋ณด์ํ ํจ์น๋ฅผ ๋ค์ ๋ณด๋
๋๋ค.
์ถฉ๋ถํ๋ค๋ฉด ๋จธ์ง ์์ ์ ์๋ ค์ฃผ๊ณ , ๋๋ ์ถ๊ฐ ๋ณด์ ์ฌํญ์ ์๋ ค์ค๋๋ค.
Refactor for loop to macro for_each_action_of_desc
---
kernel/irq/irqdesc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/irq/irqdesc.c b/kernel/irq/irqdesc.c
index d323b180b0f3..5db0230aa6b5 100644
--- a/kernel/irq/irqdesc.c
+++ b/kernel/irq/irqdesc.c
@@ -251,7 +251,7 @@ static ssize_t actions_show(struct kobject *kobj,
char *p = "";
raw_spin_lock_irq(&desc->lock);
- for (action = desc->action; action != NULL; action = action->next) {
+ for_each_action_of_desc(desc, action) {
ret += scnprintf(buf + ret, PAGE_SIZE - ret, "%s%s",
p, action->name);
p = ",";
๋ณด๋ธ ํจ์น๋ v6.0-rc1 ์์ [GIT pull] irq/core for v6.0-rc1 - by Thomas Gleixner @ 2022-08-01 14:48 UTC [1%]
๋จธ์ง๋์์ต๋๋ค.
The following commit has been merged into the irq/irqchip-next branch of irqchip:
Commit-ID: c904cda04482d5ab545e5a82cee6084078ef9543
Gitweb: https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms/c904cda04482d5ab545e5a82cee6084078ef9543
AuthorDate: Sun, 10 Jul 2022 20:26:14 +09:00
Committer: Marc Zyngier <maz@kernel.org>
CommitterDate: Wed, 20 Jul 2022 15:21:32 +01:00
genirq: Use for_each_action_of_desc in actions_show()
Refactor action_show() to use for_each_action_of_desc instead
of a similar open-coded loop.
[maz: reword commit message]
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20220710112614.19410-1-p4ranlee@gmail.com
---
kernel/irq/irqdesc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/irq/irqdesc.c b/kernel/irq/irqdesc.c
index d323b18..5db0230 100644
--- a/kernel/irq/irqdesc.c
+++ b/kernel/irq/irqdesc.c
@@ -251,7 +251,7 @@ static ssize_t actions_show(struct kobject *kobj,
char *p = "";
raw_spin_lock_irq(&desc->lock);
- for (action = desc->action; action != NULL; action = action->next) {
+ for_each_action_of_desc(desc, action) {
ret += scnprintf(buf + ret, PAGE_SIZE - ret, "%s%s",
p, action->name);
p = ",";
์ด์์ ๋๋ค. ^^7 ๊ณ ์ํ์ จ์ต๋๋ค!
๊ธฐ์ต์ ๋จ๋ ๋ช ๊ฐ์ง ํจ์น ํญ๋ชฉ๋ค์ ๋๋ค.
Xen Hypervisor
์๋ฌต์ ์ธ casting ์ผ๋ก ์ค์ ์ฝ๋๊ฐ ๊ธธ์ด์ง๋ ํ์From: Julien Grall <julien@xen.org>
Well... I don't think the one less operation is because of introduction
of the local variable (see more below).
>
> (1) before clean up
>
> 0000000000001bb4 <p2m_set_entry>:
> while ( nr )
> 1bb4: b40005e2 cbz x2, 1c70 <p2m_set_entry+0xbc>
> {
> ...
> if ( rc )
> 1c1c: 350002e0 cbnz w0, 1c78 <p2m_set_entry+0xc4>
> sgfn = gfn_add(sgfn, (1 << order));
1 << order is a 32-bit value but the second parameter is a 64-bit value
(assuming arm64). So...
> 1c20: 1ad32373 lsl w19, w27, w19 // <<< CES works
> 1c24: 93407e73 sxtw x19, w19 // <<< well!
... this instruction is extending the 32-bit value to 64-bit value.
> return _gfn(gfn_x(gfn) + i);
> 1c28: 8b1302d6 add x22, x22, x19
> return _mfn(mfn_x(mfn) + i);
> 1c2c: 8b130281 add x1, x20, x19
> 1c30: b100069f cmn x20, #0x1
> 1c34: 9a941034 csel x20, x1, x20, ne // ne = any
> while ( nr )
> 1c38: eb1302b5 subs x21, x21, x19
> 1c3c: 540001e0 b.eq 1c78 <p2m_set_entry+0xc4> // b.none
>
> (2) Using again mask variable. mask = 1UL << order
> code show me sxtw x19, w19 operation disappeared.
This code is not only using a local variable but also using "1UL". So, I
suspect that if you were using 1 << order, the instruction would re-appear.
Cheers,
Julien Grall
Uftrace
ํจ์๋ฅผ ๋ฐ์ด๋ค๋๋ ๋ถ๊ธฐ(try-catch ๊ตฌํ) longjmp() ๊ฐ ์ปดํ์ผ๋ฌ ์ต์ ํ๋ก ๋์์ ์ํ๋ ํ์diff --git a/tests/s-longjmp.c b/tests/s-longjmp.c
index 487e9264..64fc7c38 100644
--- a/tests/s-longjmp.c
+++ b/tests/s-longjmp.c
@@ -8,6 +8,9 @@ int foo(void)
return 0;
}
+#if __clang__
+__attribute__((optnone))
+#endif
int bar(void)
{
return -1;
Another solution is to make bar function has more contents
so that it can't be optimized in clang.
์ง์ง ๋ ๐ค