From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ed1-f74.google.com (mail-ed1-f74.google.com [209.85.208.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E711E340298 for ; Mon, 23 Mar 2026 12:57:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.74 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774270630; cv=none; b=iyUVVN7KOX4aWoupYVSbeYB8lv1SvnuKYAqlCrCTnTH9LoseMbqF65sNKZxmoVF9aTs0Bel/ml1bC+DdQ1dywtGISSWqOXBUAki7SdNaklsxKlsxhzyng0XTdK6Zl1Ogcr7lxo5VtYOroGmUajkT7xna8kFuPLVWUBSxqWx9LFw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774270630; c=relaxed/simple; bh=YZTKsvGS1sBakWkGCusdNskBZVQKp9PdxievAVTmkEE=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=hY8ehr4rCAPDqEKbfXKiJsgq1FRMuBjJrrH/eabRLlJ8vDcHNCacuGkrsS4mC5bMbr3XrlUo4zaLCqnzHvX6YjZqjsHLuXUSd1h0SsJ2jHR62jYrDw6wQiE8qcQ9yB2NCUj9Z9+JhsoIqi227+g8NDkmj/BOY68gVVdS/SAWANk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--jackmanb.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=V+L4uZHz; arc=none smtp.client-ip=209.85.208.74 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--jackmanb.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="V+L4uZHz" Received: by mail-ed1-f74.google.com with SMTP id 4fb4d7f45d1cf-668005baa62so151750a12.0 for ; Mon, 23 Mar 2026 05:57:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1774270627; x=1774875427; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=PLdNQKNpJfNXYzn4cpAS0Z9lYnfTUb7+HBLinvV2mSw=; b=V+L4uZHzysFqGhhnBgLwQYR5Is4cReD5jcj0vW2bQLnmC1GZ7yMPOjZKRMDTdcHHwJ UgTX1V72AgD0wcQj5Z0R4XzrM29MI4yn5Yan1a1y0PGM6FYINFKoFg1lVQ3eFRI2K0lL Z93GEaRzSbXcfqrSysguM9fnl3XIs2TnVrAaWuMyUqODeaKzc0Bzv2TnRiEY0e8n9x5G 49SwX5xqm6/vDDjUAJeSJ3iyXyWyFc1EYYmtPj624/SWLbfiVXhqAvwo/ek6TUd3fedm 1pzAqqQAFcFaUXBBbbvJYuGL4kc+QKnLAPrxPIpd17qbJ7B8Z+MGtHuszVpoE4WxSEAe XFKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774270627; x=1774875427; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=PLdNQKNpJfNXYzn4cpAS0Z9lYnfTUb7+HBLinvV2mSw=; b=NdEtJ7fL2jIs3I2Uq2UDRyd88m2DjDZ5Ind1ABoeDS1XAOiOcF6hYn+1n56BSLMmIN uW6ZiI+KRdakRzMRL2F6jcGyfz5iIVA1y3jh6Vbp4ciFTCLUDp+7ewnHjSJRlTMmOdnK 721z3NhxRWd07OgWV/FiIEpHMIp07yjYQz5ww2urhQG7p54UjO8MFwnUZyDWPUk1JD+s GMiFXQw1OSw5zz1pwvaNHl3UeNtR9yKo5f1uGqYyoADXsGgiF7qdOeLZCPttkXIOQBEt 4uIKS0Poxg5SGmZFa4dvl7TaCijk5skNEP0fiW9ALEAbBp0NYYZBd6LP96b6W+heU3Of fXrw== X-Forwarded-Encrypted: i=1; AJvYcCWUs2VMsG0r8vEmZEUw2dbLvN8DLw6auMJ1hqL6sZtA1goMYSfYuqT6fNmVcH688mqhKv4DewMfTt5E7M4=@vger.kernel.org X-Gm-Message-State: AOJu0YxY6iE7o/gBwS+9bvgb/NRYj0JhJsOURkvCqD3iv27bgZszZX6g eGgG2P4DJ0rZyKG6GUjQOz0AcvVushEL+qKdMbvPpTJwcMCjJmGyEIrs3MbvLGyBe6A2uvOPSJp W1F+TTBjeiy85rg== X-Received: from eddt7.prod.google.com ([2002:a05:6402:5247:b0:668:7e92:2c09]) (user=jackmanb job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6402:a58c:20b0:66a:31:17f9 with SMTP id 4fb4d7f45d1cf-66a003119demr990706a12.14.1774270627244; Mon, 23 Mar 2026 05:57:07 -0700 (PDT) Date: Mon, 23 Mar 2026 12:57:06 +0000 In-Reply-To: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260320-page_alloc-unmapped-v2-0-28bf1bd54f41@google.com> <20260320-page_alloc-unmapped-v2-2-28bf1bd54f41@google.com> <17e58542-1221-48dd-88b9-236128515ed2@intel.com> X-Mailer: aerc 0.21.0 Message-ID: Subject: Re: [PATCH v2 02/22] x86/mm: Generalize LDT remap into "mm-local region" From: Brendan Jackman To: Brendan Jackman , Dave Hansen , Borislav Petkov , Dave Hansen Cc: , , , , Content-Type: text/plain; charset="UTF-8" TANGENT - off topic, removing most people from CC. On Mon Mar 23, 2026 at 12:01 PM UTC, Brendan Jackman wrote: > On Fri Mar 20, 2026 at 7:47 PM UTC, Dave Hansen wrote: >>> + * We use tlb_gather_mmu_fullmm() to avoid confusing the >>> + * range-tracking logic in __tlb_adjust_range(). >>> + */ >> >> Imperative voice, please. > > Yeah I don't think I'm ever gonna stop making this mistake. Any LLM > should be able to catch this for me, I think it's time to find a way to > get that into my pre-mail workflow. Just dumping what I learned from briefly looking into this: It looks like Sashiko [0] and Chris Mason's review-prompts are not really well geared-up to deal with trivialities like this right now, they are still evolving fast and focussing on much more advanced topics, and AFAICS they don't have a standardised way for the agent to "shell out" to a cheap model to do simple checks like this. So for now until that stuff crystallises a bit more I'll just use a dumb standalone script. I wrote a quick prompt to check for these particular rules and found that the "pro" model worked perfectly but took ages (and probably an obscene amount of energy) while gemini-2.5-flash-lite was instant but very unreliable. Then I asked the pro model to rework the prompt for the benefit of the small model. Its version made the small model works reliably. I'll paste the prompt below. The command to run it using Google's stuff is: gemini --prompt "$(cat check_patch.md) $(git show)" --model "gemini-3.1-flash-lite-preview" I assume open models that fit on a laptop can handle this task too but I haven't tried it as Google's tooling seems to be hardcoded to funnel you to the cloud service. Yuck, something to figure out on the weekend I suppose. (Alternatively I bet a plain old NLTK script can handle these particular rules. But that will run into limiations quickly while dumb LLMs are generic). [0] https://lwn.net/ml/all/87jyv7a1q5.fsf@linux.dev/ --- You are a strict code reviewer. You will be given a patch file, formatted email, or Git diff. Your only task is to review the English style of newly added code comments (lines starting with '+' that are comments, e.g., '+ //', '+ /*', '+ *', or '+ #'). Ignore all actual code, variable names, and removed lines. Flag a comment if it violates either of these two rules: 1. Avoid personal pronouns. For example: Do not use: I, we, you, our, us, my, your. Other pronouns such as "it" are fine. 2. Use the imperative mood to describe what the code does. (e.g., Use "Return the value" instead of "Returns the value" or "This returns the value"). Output format: If there are no violations, output exactly: "LGTM". If there are violations, output the snippet from the input where the violation occurs. Prefix each line with a '>' character, followed by a brief description of the violated rule. ### Example 1 (Pronoun Violation) ### Input Patch: + /* + * Although free_pgd_range() is intended for freeing user + * page-tables, it also works out for kernel mappings on x86. + * We use tlb_gather_mmu_fullmm() to avoid confusing the + * range-tracking logic in __tlb_adjust_range(). + */ + tlb_gather_mmu_fullmm(&tlb, mm); Output: >+ * We use tlb_gather_mmu_fullmm() to avoid confusing the >+ * range-tracking logic in __tlb_adjust_range(). Avoid personal pronouns ("We"). ### Example 2 (Imperative Mood Violation) ### Input Patch: + // Initializes the counter and prepares the struct. + counter = 0; Output: >+ // Initializes the counter and prepares the struct. Use the imperative mood (e.g., "Initialize the counter...").