mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: jpoimboe@kernel.org, rostedt@kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 10/12] unwind: Simplify unwind_user_next_fp() alignment check
Date: Thu, 23 Oct 2025 11:53:07 +0200	[thread overview]
Message-ID: <20251023095307.GZ3245006@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <20251022112032.130218cd@gandalf.local.home>

On Wed, Oct 22, 2025 at 11:20:32AM -0400, Steven Rostedt wrote:
> On Mon, 20 Oct 2025 12:28:14 +0200
> Peter Zijlstra <peterz@infradead.org> wrote:
> 
> > On Wed, Oct 01, 2025 at 11:55:24AM -0400, Steven Rostedt wrote:
> > > On Wed, 24 Sep 2025 09:59:58 +0200
> > > Peter Zijlstra <peterz@infradead.org> wrote:
> > > 
> > > I would add a change log. Something like:
> > > 
> > >   sizeof(long) is 4 or 8. Where 4 = 1 << 2 and 8 = 1 << 3.
> > >   Calculating shift to be 2 or 3 and then passing that variable into
> > >   (1 << shift) is the same as just using sizeof(long).  
> > 
> > I've made it: "2^log_2(n) == n". I find it very hard to spend that many
> > words on something this trivial :-)
> 
> What you don't like Common Core Math[1]?

I'm not sure I'm qualified to comment on that particular topic. Yes,
there are many equivalent ways of doing 'math' and it is fun to explore
them all.

Specifically: 3000-1 and 2999+1 should both be mastered and both involve
the (decimal) carry bit. If your curriculum does not provide, or treats
one as more difficult from the other, something is wrong.

The thing I've noticed with my own kids though, is that teachers often
don't master these basics themselves, and find it very hard to properly
explain these things. This then makes me wonder HTF they ever got to be
a teacher, in face of their obvious incompetence, but that's another
problem.

[ I am now having to explain and derive the abc formula for finding the
  roots of the 2nd grade polynomial to my kid because curriculum mostly
  'forgot' about proofs and provides 'tricks' instead of understanding.

  Also, there is a very nice tie-in with this derivation of the abc
  formula to the starting point of calculus, notably the expression for
  finding the extreme is of course f'(x)=0, but is found here through
  simple algebra. ]

Anyway, I find throwing heaps of natural language at a trivial statement
makes it more opaque, rather than clearer.

  reply	other threads:[~2025-10-23  9:53 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-24  7:59 [PATCH 00/12] Various fixes and x86 support Peter Zijlstra
2025-09-24  7:59 ` [PATCH 01/12] task_work: Fix NMI race condition Peter Zijlstra
2025-10-01 15:31   ` Steven Rostedt
2025-10-29  9:36   ` [tip: perf/core] " tip-bot2 for Peter Zijlstra
2025-09-24  7:59 ` [PATCH 02/12] unwind: Shorten lines Peter Zijlstra
2025-10-01 15:32   ` Steven Rostedt
2025-10-29  9:36   ` [tip: perf/core] " tip-bot2 for Peter Zijlstra
2025-09-24  7:59 ` [PATCH 03/12] unwind: Add required include files Peter Zijlstra
2025-10-01 15:32   ` Steven Rostedt
2025-10-29  9:36   ` [tip: perf/core] " tip-bot2 for Peter Zijlstra
2025-09-24  7:59 ` [PATCH 04/12] unwind: Simplify unwind_reset_info() Peter Zijlstra
2025-10-01 15:33   ` Steven Rostedt
2025-10-29  9:36   ` [tip: perf/core] " tip-bot2 for Peter Zijlstra
2025-09-24  7:59 ` [PATCH 05/12] unwind: Add comment to unwind_deferred_task_exit() Peter Zijlstra
2025-10-01 15:35   ` Steven Rostedt
2025-10-20 10:16     ` Peter Zijlstra
2025-10-22 15:16       ` Steven Rostedt
2025-10-29  9:36   ` [tip: perf/core] " tip-bot2 for Peter Zijlstra
2025-09-24  7:59 ` [PATCH 06/12] unwind: Fix unwind_deferred_request() vs NMI Peter Zijlstra
2025-10-01 15:37   ` Steven Rostedt
2025-10-29  9:36   ` [tip: perf/core] " tip-bot2 for Peter Zijlstra
2025-09-24  7:59 ` [PATCH 07/12] unwind: Clarify calling context Peter Zijlstra
2025-10-01 15:38   ` Steven Rostedt
2025-10-29  9:36   ` [tip: perf/core] " tip-bot2 for Peter Zijlstra
2025-09-24  7:59 ` [PATCH 08/12] unwind: Simplify unwind_user_faultable() Peter Zijlstra
2025-10-01 15:40   ` Steven Rostedt
2025-10-20 10:17     ` Peter Zijlstra
2025-10-29  9:36   ` [tip: perf/core] " tip-bot2 for Peter Zijlstra
2025-09-24  7:59 ` [PATCH 09/12] unwind: Make unwind_task_info::unwind_mask consistent Peter Zijlstra
2025-10-01 15:47   ` Steven Rostedt
2025-10-20 10:20     ` Peter Zijlstra
2025-10-29  9:36   ` [tip: perf/core] " tip-bot2 for Peter Zijlstra
2025-09-24  7:59 ` [PATCH 10/12] unwind: Simplify unwind_user_next_fp() alignment check Peter Zijlstra
2025-10-01 15:55   ` Steven Rostedt
2025-10-20 10:28     ` Peter Zijlstra
2025-10-22 15:20       ` Steven Rostedt
2025-10-23  9:53         ` Peter Zijlstra [this message]
2025-10-29  9:36   ` [tip: perf/core] " tip-bot2 for Peter Zijlstra
2025-09-24  7:59 ` [PATCH 11/12] unwind: Implement compat fp unwind Peter Zijlstra
2025-10-17 15:47   ` Jens Remus
2025-10-20  9:16     ` Jens Remus
2025-10-20 10:39       ` Peter Zijlstra
2025-10-20 10:48         ` Peter Zijlstra
2025-10-22 15:23           ` Steven Rostedt
2025-10-24 13:45             ` Peter Zijlstra
2025-10-22 14:55         ` Jens Remus
2025-10-24 13:40           ` Peter Zijlstra
2025-10-20 10:38     ` Peter Zijlstra
2025-10-22 18:31   ` Steven Rostedt
2025-10-24 14:10     ` Peter Zijlstra
2025-10-24 14:16       ` Peter Zijlstra
2025-10-29  9:36   ` [tip: perf/core] " tip-bot2 for Peter Zijlstra
2025-09-24  8:00 ` [PATCH 12/12] unwind_user/x86: Enable frame pointer unwinding on x86 Peter Zijlstra

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=20251023095307.GZ3245006@noisy.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=jpoimboe@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=rostedt@kernel.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

all inboxes | Powered by JetHome®