Re: [PATCH 1/5] mm/migrate.c: remove unnecessary VM_BUG_ON_PAGE on putback_movable_page()

2021-03-20 Thread Rafael Aquini
On Sat, Mar 20, 2021 at 05:36:57AM -0400, Miaohe Lin wrote: > The !PageLocked() check is implicitly done in PageMovable(). Remove this > explicit one. > I'd just keep the explicit assertion in place, regardless. But if you're going to stick with this patch, please fix it because it's removing

[PATCH v2] mm/slab_common: provide "slab_merge" option for !IS_ENABLED(CONFIG_SLAB_MERGE_DEFAULT) builds

2021-03-19 Thread Rafael Aquini
This is a minor addition to the allocator setup options to provide a simple way to on demand enable back cache merging for builds that by default run with CONFIG_SLAB_MERGE_DEFAULT not set. Signed-off-by: Rafael Aquini --- v2 changelog: * fix __setup("slab_merge", setup_slab_nome

Re: [PATCH] mm/slab_common: provide "slab_merge" option for !IS_ENABLED(CONFIG_SLAB_MERGE_DEFAULT) builds

2021-03-19 Thread Rafael Aquini
On Fri, Mar 19, 2021 at 03:22:33PM -0400, Rafael Aquini wrote: > This is a minor addition to the allocator setup options to provide > a simple way to on demand enable back cache merging for builds > that by default run with CONFIG_SLAB_MERGE_DEFAULT not set. > > Signed-off-by

[PATCH] mm/slab_common: provide "slab_merge" option for !IS_ENABLED(CONFIG_SLAB_MERGE_DEFAULT) builds

2021-03-19 Thread Rafael Aquini
This is a minor addition to the allocator setup options to provide a simple way to on demand enable back cache merging for builds that by default run with CONFIG_SLAB_MERGE_DEFAULT not set. Signed-off-by: Rafael Aquini --- Documentation/admin-guide/kernel-parameters.txt | 7 +++ mm

Re: [PATCH] mm: swapfile: avoid split_swap_cluster() NULL pointer dereference

2020-10-05 Thread Rafael Aquini
On Thu, Oct 01, 2020 at 10:31:57AM -0400, Rafael Aquini wrote: > On Fri, Sep 25, 2020 at 11:21:58AM +0800, Huang, Ying wrote: > > Rafael Aquini writes: > > >> Or, can you help to run the test with a debug kernel based on upstream > > >> kernel

Re: [PATCH] mm: swapfile: avoid split_swap_cluster() NULL pointer dereference

2020-10-01 Thread Rafael Aquini
On Fri, Sep 25, 2020 at 11:21:58AM +0800, Huang, Ying wrote: > Rafael Aquini writes: > >> Or, can you help to run the test with a debug kernel based on upstream > >> kernel. I can provide some debug patch. > >> > > > > Sure, I can set your patches to

Re: [PATCH 1/2] mempolicy: Rename MPOL_F_MORON to MPOL_F_MOPRON

2020-09-26 Thread Rafael Aquini
_str(char *buffer, int maxlen, struct > mempolicy *pol) > unsigned short mode = MPOL_DEFAULT; > unsigned short flags = 0; > > - if (pol && pol != _policy && !(pol->flags & MPOL_F_MORON)) { > + if (pol && pol != _policy && !(pol->flags & MPOL_F_MOPRON)) { > mode = pol->mode; > flags = pol->flags; > } > -- > 2.28.0 > > Acked-by: Rafael Aquini

Re: [PATCH] mm: swapfile: avoid split_swap_cluster() NULL pointer dereference

2020-09-26 Thread Rafael Aquini
On Fri, Sep 25, 2020 at 11:21:58AM +0800, Huang, Ying wrote: > Rafael Aquini writes: > >> Or, can you help to run the test with a debug kernel based on upstream > >> kernel. I can provide some debug patch. > >> > > > > Sure, I can set your patches to

Re: [PATCH] mm: swapfile: avoid split_swap_cluster() NULL pointer dereference

2020-09-24 Thread Rafael Aquini
On Thu, Sep 24, 2020 at 03:45:52PM +0800, Huang, Ying wrote: > Rafael Aquini writes: > > > On Thu, Sep 24, 2020 at 11:51:17AM +0800, Huang, Ying wrote: > >> Rafael Aquini writes: > >> > The bug here is quite simple: split_swap_cluster() misses checking for >

Re: [PATCH] mm: swapfile: avoid split_swap_cluster() NULL pointer dereference

2020-09-24 Thread Rafael Aquini
On Thu, Sep 24, 2020 at 11:51:17AM +0800, Huang, Ying wrote: > Rafael Aquini writes: > > The bug here is quite simple: split_swap_cluster() misses checking for > > lock_cluster() returning NULL before committing to change > > cluster_info->flags. > > I don

Re: [PATCH] mm: swapfile: avoid split_swap_cluster() NULL pointer dereference

2020-09-23 Thread Rafael Aquini
On Thu, Sep 24, 2020 at 08:59:40AM +0800, Huang, Ying wrote: > Rafael Aquini writes: > > > On Wed, Sep 23, 2020 at 01:13:49PM +0800, Huang, Ying wrote: > >> Rafael Aquini writes: > >> > >> > On Wed, Sep 23, 2020 at 10:21:36AM +0

Re: [PATCH] mm: swapfile: avoid split_swap_cluster() NULL pointer dereference

2020-09-23 Thread Rafael Aquini
On Tue, Sep 22, 2020 at 12:47:50PM -0700, Andrew Morton wrote: > On Tue, 22 Sep 2020 14:48:38 -0400 Rafael Aquini wrote: > > > The swap area descriptor only gets struct swap_cluster_info *cluster_info > > allocated if the swapfile is backed by non-rotational storage. >

Re: [PATCH] mm: swapfile: avoid split_swap_cluster() NULL pointer dereference

2020-09-23 Thread Rafael Aquini
On Wed, Sep 23, 2020 at 01:13:49PM +0800, Huang, Ying wrote: > Rafael Aquini writes: > > > On Wed, Sep 23, 2020 at 10:21:36AM +0800, Huang, Ying wrote: > >> Hi, Rafael, > >> > >> Rafael Aquini writes: > >> > >> > The swap area

Re: [PATCH] mm: swapfile: avoid split_swap_cluster() NULL pointer dereference

2020-09-22 Thread Rafael Aquini
On Wed, Sep 23, 2020 at 10:21:36AM +0800, Huang, Ying wrote: > Hi, Rafael, > > Rafael Aquini writes: > > > The swap area descriptor only gets struct swap_cluster_info *cluster_info > > allocated if the swapfile is backed by non-rotational storage. > > Whe

[PATCH] mm: swapfile: avoid split_swap_cluster() NULL pointer dereference

2020-09-22 Thread Rafael Aquini
uot;mm, THP, swap: support splitting THP for THP swap out") Signed-off-by: Rafael Aquini --- mm/swapfile.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mm/swapfile.c b/mm/swapfile.c index 12f59e641b5e..37ddf5e5c53b 100644 --- a/mm/swapfile.c +++ b/mm/swapfile.c @@

Re: [PATCH v2] mm, THP, swap: fix allocating cluster for swapfile by mistake

2020-08-20 Thread Rafael Aquini
On Fri, Aug 21, 2020 at 09:34:46AM +1000, Dave Chinner wrote: > On Thu, Aug 20, 2020 at 12:53:23PM +0800, Gao Xiang wrote: > > SWP_FS is used to make swap_{read,write}page() go through > > the filesystem, and it's only used for swap files over > > NFS. So, !SWP_FS means non NFS for now, it could

Re: [PATCH v2] mm, THP, swap: fix allocating cluster for swapfile by mistake

2020-08-20 Thread Rafael Aquini
; > stress --vm 2 --vm-bytes 600M # doesn't matter too much as well > > Symptoms: > - FS corruption (e.g. checksum failure) > - memory corruption at: 0xd2808010 > - segfault > > Fixes: f0eea189e8e9 ("mm, THP, swap: Don't allocate huge cluster for file

Re: [PATCH] mm, THP, swap: fix allocating cluster for swapfile by mistake

2020-08-19 Thread Rafael Aquini
On Wed, Aug 19, 2020 at 01:05:06PM -0700, Andrew Morton wrote: > On Thu, 20 Aug 2020 03:56:13 +0800 Gao Xiang wrote: > > > SWP_FS doesn't mean the device is file-backed swap device, > > which just means each writeback request should go through fs > > by DIO. Or it'll just use extents added by

Re: [PATCH] mm/page_alloc: fix documentation error and remove magic numbers

2020-06-24 Thread Rafael Aquini
On Wed, Jun 24, 2020 at 03:09:58PM +0100, Matthew Wilcox wrote: > On Wed, Jun 24, 2020 at 10:07:27AM -0400, Rafael Aquini wrote: > > On Wed, Jun 24, 2020 at 12:12:55PM +0100, Matthew Wilcox wrote: > > > On Tue, Jun 23, 2020 at 11:27:12PM -0400, Joel Savitz wrote: > > >

Re: [PATCH] mm/page_alloc: fix documentation error and remove magic numbers

2020-06-24 Thread Rafael Aquini
On Wed, Jun 24, 2020 at 12:12:55PM +0100, Matthew Wilcox wrote: > On Tue, Jun 23, 2020 at 11:27:12PM -0400, Joel Savitz wrote: > > In addition, this patch replaces the magic number bounds with symbolic > > constants to clarify the logic. > > Why do people think this kind of thing makes the code

Re: [PATCH mmotm] mm/swap: fix livelock in __read_swap_cache_async()

2020-05-22 Thread Rafael Aquini
harge(page, NULL, gfp_mask)) { > + delete_from_swap_cache(page); > + goto fail_unlock; > + } > > - /* Initiate read into locked page */ > + /* Caller will initiate read into locked page */ > SetPageWorkingset(page); > lru_cache_add_anon(page); > *new_page_allocated = true; > return page; > > -fail_delete: > - delete_from_swap_cache(page); > fail_unlock: > unlock_page(page); > put_page(page); > -fail_free: > - swap_free(entry); > return NULL; > } > > Acked-by: Rafael Aquini

Re: [PATCH v2 15/15] mwl8k: use new module_firmware_crashed()

2020-05-15 Thread Rafael Aquini
> + module_firmware_crashed(); > if (priv->hw_restart_owner == current) > return 0; > else > -- > 2.26.2 > Acked-by: Rafael Aquini

Re: [PATCH v2 14/15] brcm80211: use new module_firmware_crashed()

2020-05-15 Thread Rafael Aquini
ers/net/wireless/broadcom/brcm80211/brcmfmac/core.c > @@ -1393,6 +1393,7 @@ void brcmf_fw_crashed(struct device *dev) > struct brcmf_pub *drvr = bus_if->drvr; > > bphy_err(drvr, "Firmware has halted or crashed\n"); > + module_firmware_crashed(); > > brcmf_dev_coredump(dev); > > -- > 2.26.2 > Acked-by: Rafael Aquini

Re: [PATCH v2 13/15] ath6kl: use new module_firmware_crashed()

2020-05-15 Thread Rafael Aquini
/net/wireless/ath/ath6kl/hif.c > @@ -120,6 +120,7 @@ static int ath6kl_hif_proc_dbg_intr(struct ath6kl_device > *dev) > int ret; > > ath6kl_warn("firmware crashed\n"); > + module_firmware_crashed(); > > /* >* read counter to clear the interrupt, the debug error interrupt is > -- > 2.26.2 > Acked-by: Rafael Aquini

Re: [PATCH v2 11/15] wimax/i2400m: use new module_firmware_crashed()

2020-05-15 Thread Rafael Aquini
d(); > skb_queue_walk(>queue, skb_itr) { > roq_data_itr = (struct i2400m_roq_data *) _itr->cb; > nsn_itr = __i2400m_roq_nsn(roq, roq_data_itr->sn); > -- > 2.26.2 > Acked-by: Rafael Aquini

Re: [PATCH v2 12/15] ath10k: use new module_firmware_crashed()

2020-05-15 Thread Rafael Aquini
th10k/snoc.c > index 354d49b1cd45..7cfc123c345c 100644 > --- a/drivers/net/wireless/ath/ath10k/snoc.c > +++ b/drivers/net/wireless/ath/ath10k/snoc.c > @@ -1451,6 +1451,7 @@ void ath10k_snoc_fw_crashed_dump(struct ath10k *ar) > scnprintf(guid, sizeof(guid), "n/a"); > > ath10k_err(ar, "firmware crashed! (guid %s)\n", guid); > + module_firmware_crashed(); > ath10k_print_driver_info(ar); > ath10k_msa_dump_memory(ar, crash_data); > mutex_unlock(>dump_mutex); > -- > 2.26.2 > Acked-by: Rafael Aquini

Re: [PATCH v2 09/15] qed: use new module_firmware_crashed()

2020-05-15 Thread Rafael Aquini
p_mb_params->cmd, p_mb_params->param); > + module_firmware_crashed(); > qed_mcp_print_cpu_info(p_hwfn, p_ptt); > > spin_lock_bh(_hwfn->mcp_info->cmd_lock); > -- > 2.26.2 > Acked-by: Rafael Aquini

Re: [PATCH v2 10/15] soc: qcom: ipa: use new module_firmware_crashed()

2020-05-15 Thread Rafael Aquini
pdev->dev; > int ret; > > + module_firmware_crashed(); > ipa_endpoint_modem_pause_all(ipa, true); > > ipa_endpoint_modem_hol_block_clear_all(ipa); > -- > 2.26.2 > Acked-by: Rafael Aquini

Re: [PATCH v2 08/15] ehea: use new module_firmware_crashed()

2020-05-15 Thread Rafael Aquini
8 @@ static void ehea_crash_handler(void) > { > int i; > > + module_firmware_crashed(); > + > if (ehea_fw_handles.arr) > for (i = 0; i < ehea_fw_handles.num_entries; i++) > ehea_h_free_resource(ehea_fw_handles.arr[i].adh, > -- > 2.26.2 > Acked-by: Rafael Aquini

Re: [PATCH v2 07/15] cxgb4: use new module_firmware_crashed()

2020-05-15 Thread Rafael Aquini
4_main.c > @@ -3646,6 +3646,7 @@ void t4_fatal_err(struct adapter *adap) >* could be exposed to the adapter. RDMA MWs for example... >*/ > t4_shutdown_adapter(adap); > + module_firmware_crashed(); > for_each_port(adap, port) { > str

Re: [PATCH v2 06/15] liquidio: use new module_firmware_crashed()

2020-05-15 Thread Rafael Aquini
module_firmware_crashed(); > other_oct = get_other_octeon_device(oct); > if (other_oct) > WRITE_ONCE(other_oct->cores_crashed, true); > -- > 2.26.2 > Acked-by: Rafael Aquini

Re: [PATCH v2 05/15] bna: use new module_firmware_crashed()

2020-05-15 Thread Rafael Aquini
g_save_ftrc(iocpf->ioc); > bfa_ioc_hw_sem_get(iocpf->ioc); > } > -- > 2.26.2 > Acked-by: Rafael Aquini

Re: [PATCH v2 04/15] bnxt: use new module_firmware_crashed()

2020-05-15 Thread Rafael Aquini
TEE_BNXT_FW > return tee_bnxt_copy_coredump(buf, 0, dump->len); > #endif > -- > 2.26.2 > Acked-by: Rafael Aquini

Re: [PATCH v2 03/15] bnx2x: use new module_firmware_crashed()

2020-05-15 Thread Rafael Aquini
t; + module_firmware_crashed(); > BNX2X_ERR("begin crash dump -\n"); > > /* Indices */ > -- > 2.26.2 > Acked-by: Rafael Aquini

Re: [PATCH v2 02/15] ethernet/839: use new module_firmware_crashed()

2020-05-15 Thread Rafael Aquini
this_frame, ei_local->current_page); > + } > > if (this_frame == rxing_page) /* Read all the frames? */ > break; /* Done for now */ > -- > 2.26.2 > Acked-by: Rafael Aquini

Re: [PATCH v2 01/15] taint: add module firmware crash taint support

2020-05-15 Thread Rafael Aquini
rnel/panic.c| 1 + > tools/debugging/kernel-chktaint | 7 +++ > 7 files changed, 34 insertions(+), 4 deletions(-) > Reviewed-by: Rafael Aquini

[PATCH v5] kernel: add panic_on_taint

2020-05-15 Thread Rafael Aquini
for the running system. The optional switch 'nousertaint' is handy in this particular scenario, as it will avoid userspace induced crashes by writes to sysctl interface /proc/sys/kernel/tainted causing false positive hits for such policies. Suggested-by: Qian Cai Signed-off-by: Rafael Aquini

Re: [PATCH v4] kernel: add panic_on_taint

2020-05-13 Thread Rafael Aquini
On Wed, May 13, 2020 at 03:47:22PM +, Luis Chamberlain wrote: > On Wed, May 13, 2020 at 11:00:26AM -0400, Rafael Aquini wrote: > > Analogously to the introduction of panic_on_warn, this patch > > introduces a kernel option named panic_on_taint in order to > > provide a s

[PATCH v4] kernel: add panic_on_taint

2020-05-13 Thread Rafael Aquini
), is allowed for the running system. The optional switch 'nousertaint' is handy in this particular scenario as it will avoid userspace induced crashes by writes to /proc/sys/kernel/tainted causing false positive hits for such policies. Suggested-by: Qian Cai Signed-off-by: Rafael Aquini

Re: [PATCH v2] kernel: sysctl: ignore out-of-range taint bits introduced via kernel.tainted

2020-05-12 Thread Rafael Aquini
On Wed, May 13, 2020 at 12:39:53AM +, Luis Chamberlain wrote: > On Tue, May 12, 2020 at 06:39:46PM -0400, Rafael Aquini wrote: > > Users with SYS_ADMIN capability can add arbitrary taint flags > > to the running kernel by writing to /proc/sys/kernel/tainted > > or issuin

[PATCH v2] kernel: sysctl: ignore out-of-range taint bits introduced via kernel.tainted

2020-05-12 Thread Rafael Aquini
to the tainted_mask bitset. This patch introduces a simple way for proc_taint() to ignore any eventual invalid bit coming from the user input before committing those bits to the kernel tainted_mask. Signed-off-by: Rafael Aquini --- Changelog: v2: simplify the bit iterator within proc_taint

Re: [PATCH] kernel: sysctl: ignore out-of-range taint bits introduced via kernel.tainted

2020-05-12 Thread Rafael Aquini
On Tue, May 12, 2020 at 01:53:26PM -0700, Andrew Morton wrote: > On Tue, 12 May 2020 13:46:53 -0400 Rafael Aquini wrote: > > > The sysctl knob > > /proc/sys/kernel/tainted, yes? > > > allows users with SYS_ADMIN capability to > > taint the kernel with an

[PATCH] kernel: sysctl: ignore out-of-range taint bits introduced via kernel.tainted

2020-05-12 Thread Rafael Aquini
before committing those bits to the kernel tainted_mask. Signed-off-by: Rafael Aquini --- include/linux/kernel.h | 2 ++ kernel/sysctl.c| 14 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 9b7a8d74a9d6

Re: [PATCH] kernel: sysctl: ignore invalid taint bits introduced via kernel.tainted and taint the kernel with TAINT_USER on writes

2020-05-12 Thread Rafael Aquini
On Tue, May 12, 2020 at 03:46:54PM +, Luis Chamberlain wrote: > On Tue, May 12, 2020 at 10:49:06AM -0400, Rafael Aquini wrote: > > On Tue, May 12, 2020 at 05:04:05AM +, Luis Chamberlain wrote: > > > On Mon, May 11, 2020 at 09:03:13PM -0400, Rafael Aquini wrote: > >

Re: [PATCH] kernel: sysctl: ignore invalid taint bits introduced via kernel.tainted and taint the kernel with TAINT_USER on writes

2020-05-12 Thread Rafael Aquini
On Tue, May 12, 2020 at 05:04:05AM +, Luis Chamberlain wrote: > On Mon, May 11, 2020 at 09:03:13PM -0400, Rafael Aquini wrote: > > On Tue, May 12, 2020 at 12:17:03AM +, Luis Chamberlain wrote: > > > On Mon, May 11, 2020 at 07:59:14PM -0400, Rafael Aquini wrote: > >

Re: [PATCH] kernel: sysctl: ignore invalid taint bits introduced via kernel.tainted and taint the kernel with TAINT_USER on writes

2020-05-11 Thread Rafael Aquini
On Tue, May 12, 2020 at 12:17:03AM +, Luis Chamberlain wrote: > On Mon, May 11, 2020 at 07:59:14PM -0400, Rafael Aquini wrote: > > On Mon, May 11, 2020 at 11:10:45PM +, Luis Chamberlain wrote: > > > On Mon, May 11, 2020 at 05:59:04PM -0400, Rafael Aquini wrote: > >

Re: [PATCH] kernel: sysctl: ignore invalid taint bits introduced via kernel.tainted and taint the kernel with TAINT_USER on writes

2020-05-11 Thread Rafael Aquini
On Mon, May 11, 2020 at 11:10:45PM +, Luis Chamberlain wrote: > On Mon, May 11, 2020 at 05:59:04PM -0400, Rafael Aquini wrote: > > The sysctl knob allows any user with SYS_ADMIN capability to > > taint the kernel with any arbitrary value, but this might > > produce an

[PATCH] kernel: sysctl: ignore invalid taint bits introduced via kernel.tainted and taint the kernel with TAINT_USER on writes

2020-05-11 Thread Rafael Aquini
before committing those bits to the kernel tainted_mask, as well as it makes clear use of TAINT_USER flag to mark the kernel tainted by user everytime a taint value is written to the kernel.tainted sysctl. Signed-off-by: Rafael Aquini --- kernel/sysctl.c | 17 - 1 file changed

Re: [PATCH v3] kernel: add panic_on_taint

2020-05-11 Thread Rafael Aquini
On Mon, May 11, 2020 at 06:24:55PM +, Luis Chamberlain wrote: > On Sat, May 09, 2020 at 09:57:37AM -0400, Rafael Aquini wrote: > > +Trigger Kdump on add_taint() > > + > > + > > +The kernel parameter, panic_on_taint, calls panic()

Re: [PATCH v3] kernel: add panic_on_taint

2020-05-10 Thread Rafael Aquini
On Sun, May 10, 2020 at 10:59:21AM +0800, Baoquan He wrote: > On 05/09/20 at 09:57am, Rafael Aquini wrote: > > Analogously to the introduction of panic_on_warn, this patch > > introduces a kernel option named panic_on_taint in order to > > provide a simple and generic

Re: [PATCH 01/15] taint: add module firmware crash taint support

2020-05-09 Thread Rafael Aquini
On Sat, May 09, 2020 at 04:35:38AM +, Luis Chamberlain wrote: > Device driver firmware can crash, and sometimes, this can leave your > system in a state which makes the device or subsystem completely > useless. Detecting this by inspecting /proc/sys/kernel/tainted instead > of scraping some

Re: [PATCH v2] kernel: add panic_on_taint

2020-05-09 Thread Rafael Aquini
On Sat, May 09, 2020 at 03:48:54AM +, Luis Chamberlain wrote: > On Fri, May 08, 2020 at 08:47:19AM -0400, Rafael Aquini wrote: > > On Thu, May 07, 2020 at 10:25:58PM +, Luis Chamberlain wrote: > > > On Thu, May 07, 2020 at 06:06:06PM -0400, Rafael Aquini wrote: > >

[PATCH v3] kernel: add panic_on_taint

2020-05-09 Thread Rafael Aquini
for the running system. Suggested-by: Qian Cai Signed-off-by: Rafael Aquini --- Changelog: * v2: get rid of unnecessary/misguided compiler hints (Luis) * v2: enhance documentation text for the new kernel parameter (Randy) * v3: drop sysctl interface, keep it only as a kernel parameter (Luis

Re: [RFC] taint: add module firmware crash taint support

2020-05-08 Thread Rafael Aquini
On Fri, May 08, 2020 at 02:14:38AM +, Luis Chamberlain wrote: > Device driver firmware can crash, and sometimes, this can leave your > system in a state which makes the device or subsystem completely > useless. Detecting this by inspecting /proc/sys/kernel/tainted instead > of scraping some

Re: [PATCH v2] kernel: add panic_on_taint

2020-05-08 Thread Rafael Aquini
On Thu, May 07, 2020 at 10:25:58PM +, Luis Chamberlain wrote: > On Thu, May 07, 2020 at 06:06:06PM -0400, Rafael Aquini wrote: > > On Thu, May 07, 2020 at 08:33:40PM +, Luis Chamberlain wrote: > > > I *think* that a cmdline route to enable this would likely rem

Re: [PATCH] kernel: add panic_on_taint

2020-05-07 Thread Rafael Aquini
On Thu, May 07, 2020 at 07:07:20PM -0400, Qian Cai wrote: > > > > On May 7, 2020, at 6:15 PM, Rafael Aquini wrote: > > > > It's a reasonable and self-contained feature that we have a valid use for. > > I honestly fail to see it causing that amount of annoyance a

Re: [PATCH] kernel: add panic_on_taint

2020-05-07 Thread Rafael Aquini
On Thu, May 07, 2020 at 06:05:27PM -0400, Qian Cai wrote: > > > > On May 7, 2020, at 4:42 PM, Rafael Aquini wrote: > > > > On Wed, May 06, 2020 at 10:50:19PM -0400, Qian Cai wrote: > >> > >> > >>> On May 6, 2020, at 6:28 PM, Rafael Aquin

Re: [PATCH v2] kernel: add panic_on_taint

2020-05-07 Thread Rafael Aquini
On Thu, May 07, 2020 at 08:33:40PM +, Luis Chamberlain wrote: > On Thu, May 07, 2020 at 02:47:05PM -0400, Rafael Aquini wrote: > > On Thu, May 07, 2020 at 02:43:16PM -0400, Rafael Aquini wrote: > > > On Thu, May 07, 2020 at 06:22:57PM +, Luis Chamberlain wrote: > >

Re: [PATCH] kernel: add panic_on_taint

2020-05-07 Thread Rafael Aquini
On Wed, May 06, 2020 at 10:50:19PM -0400, Qian Cai wrote: > > > > On May 6, 2020, at 6:28 PM, Rafael Aquini wrote: > > > > Analogously to the introduction of panic_on_warn, this patch > > introduces a kernel option named panic_on_taint in order to > > prov

Re: [PATCH v2] kernel: add panic_on_taint

2020-05-07 Thread Rafael Aquini
On Thu, May 07, 2020 at 06:50:46PM +, Luis Chamberlain wrote: > On Thu, May 07, 2020 at 02:06:31PM -0400, Rafael Aquini wrote: > > Another, perhaps less frequent, use for this option would be > > as a mean for assuring a security policy (in paranoid mode) > > case

Re: [PATCH v2] kernel: add panic_on_taint

2020-05-07 Thread Rafael Aquini
On Thu, May 07, 2020 at 02:43:16PM -0400, Rafael Aquini wrote: > On Thu, May 07, 2020 at 06:22:57PM +, Luis Chamberlain wrote: > > On Thu, May 07, 2020 at 02:06:31PM -0400, Rafael Aquini wrote: > > > diff --git a/kernel/sysctl.c b/kernel/sysctl.c > > > index 8a176d

Re: [PATCH v2] kernel: add panic_on_taint

2020-05-07 Thread Rafael Aquini
On Thu, May 07, 2020 at 06:22:57PM +, Luis Chamberlain wrote: > On Thu, May 07, 2020 at 02:06:31PM -0400, Rafael Aquini wrote: > > diff --git a/kernel/sysctl.c b/kernel/sysctl.c > > index 8a176d8727a3..b80ab660d727 100644 > > --- a/kernel/sysctl.c > > +++ b/ker

[PATCH v2] kernel: add panic_on_taint

2020-05-07 Thread Rafael Aquini
for the running system. Suggested-by: Qian Cai Signed-off-by: Rafael Aquini --- Changelog, from v1: * get rid of unnecessary/misguided compiler hints (Luis) * enhance documentation text for the new kernel parameter (Randy) Documentation/admin-guide/kdump/kdump.rst | 10

Re: [PATCH v2] mm: expand documentation over __read_mostly

2020-05-07 Thread Rafael Aquini
stification in your > + * commit log > */ > #ifndef __read_mostly > #define __read_mostly > -- > 2.25.1 > Acked-by: Rafael Aquini

Re: [PATCH] kernel: add panic_on_taint

2020-05-06 Thread Rafael Aquini
On Wed, May 06, 2020 at 11:24:48PM +, Luis Chamberlain wrote: > On Wed, May 06, 2020 at 06:28:15PM -0400, Rafael Aquini wrote: > > Analogously to the introduction of panic_on_warn, this patch > > introduces a kernel option named panic_on_taint in order to > > provide a s

Re: [PATCH] mm: expland documentation over __read_mostly

2020-05-06 Thread Rafael Aquini
a *good* justification in your > + * commit log > */ > #ifndef __read_mostly > #define __read_mostly > -- > 2.25.1 > Acked-by: Rafael Aquini

[PATCH] kernel: add panic_on_taint

2020-05-06 Thread Rafael Aquini
for the running system. Suggested-by: Qian Cai Signed-off-by: Rafael Aquini --- Documentation/admin-guide/kdump/kdump.rst | 10 ++ .../admin-guide/kernel-parameters.txt | 3 ++ Documentation/admin-guide/sysctl/kernel.rst | 36 +++ include/linux/kernel.h

Re: [PATCH] mm: slub: add panic_on_error to the debug facilities

2020-05-03 Thread Rafael Aquini
On Sat, May 02, 2020 at 11:16:30PM +, Christopher Lameter wrote: > On Fri, 1 May 2020, Rafael Aquini wrote: > > > Sometimes it is desirable to override SLUB's debug facilities > > default behavior upon stumbling on a cache or object error > > and just stop the ex

Re: [PATCH] mm: slub: add panic_on_error to the debug facilities

2020-05-03 Thread Rafael Aquini
On Fri, May 01, 2020 at 07:17:24PM -0400, Qian Cai wrote: > > > > On May 1, 2020, at 5:54 PM, Rafael Aquini wrote: > > > > It seems like a good idea which also would required "adding things" > > elsewhere, but doesn't look mutually exclusive with the app

Re: [PATCH] mm: slub: add panic_on_error to the debug facilities

2020-05-01 Thread Rafael Aquini
On Fri, May 01, 2020 at 05:29:19PM -0400, Qian Cai wrote: > > > > On May 1, 2020, at 5:15 PM, Rafael Aquini wrote: > > > > Sometimes it is desirable to override SLUB's debug facilities > > default behavior upon stumbling on a cache or object error > >

Re: [PATCH] mm: slub: add panic_on_error to the debug facilities

2020-05-01 Thread Rafael Aquini
On Fri, May 01, 2020 at 02:37:51PM -0700, Andrew Morton wrote: > On Fri, 1 May 2020 17:15:40 -0400 Rafael Aquini wrote: > > > Sometimes it is desirable to override SLUB's debug facilities > > default behavior upon stumbling on a cache or object error > > and just sto

Re: [PATCH v3] mm/slub: Fix incorrect interpretation of s->offset

2020-05-01 Thread Rafael Aquini
. Cannot check >* freepointer while object is allocated. > @@ -3587,6 +3597,11 @@ static int calculate_sizes(struct kmem_cache *s, int > forced_order) >* >* This is the case if we do RCU, have a constructor or >* destructor or are poisoning the objects. > + * > + * The assumption that s->offset >= s->inuse means free > + * pointer is outside of the object is used in the > + * freeptr_outside_object() function. If that is no > + * longer true, the function needs to be modified. >*/ > s->offset = size; > size += sizeof(void *); > -- > 2.18.1 > > Acked-by: Rafael Aquini

[PATCH] mm: slub: add panic_on_error to the debug facilities

2020-05-01 Thread Rafael Aquini
. This patch introduces a new debug flag SLAB_PANIC_ON_ERROR, along with its related SLUB-machinery, in order to extend current slub_debug facilites and provide the aforementioned behavior override. Signed-off-by: Rafael Aquini --- Documentation/vm/slub.rst | 2 ++ include/linux/slab.h | 2

Re: [PATCH] mm/vmstat: Reduce zone lock hold time when reading /proc/pagetypeinfo

2019-10-23 Thread Rafael Aquini
On Wed, Oct 23, 2019 at 10:48:13AM -0400, Qian Cai wrote: > On Wed, 2019-10-23 at 10:30 -0400, Waiman Long wrote: > > On 10/22/19 5:59 PM, Andrew Morton wrote: > > > On Tue, 22 Oct 2019 12:21:56 -0400 Waiman Long wrote: > > > > > > > The pagetypeinfo_showfree_print() function prints out the

Re: [RFC PATCH 1/2] mm, vmstat: hide /proc/pagetypeinfo from normal users

2019-10-23 Thread Rafael Aquini
create_seq("pagetypeinfo", 0444, NULL, _op); > + proc_create_seq("pagetypeinfo", 0400, NULL, _op); > proc_create_seq("vmstat", 0444, NULL, _op); > proc_create_seq("zoneinfo", 0444, NULL, _op); > #endif > -- > 2.20.1 > Acked-by: Rafael Aquini

Re: [RFC PATCH 2/2] mm, vmstat: reduce zone->lock holding time by /proc/pagetypeinfo

2019-10-23 Thread Rafael Aquini
On Wed, Oct 23, 2019 at 03:32:05PM +0200, Vlastimil Babka wrote: > On 10/23/19 12:27 PM, Michal Hocko wrote: > > From: Michal Hocko > > > > pagetypeinfo_showfree_print is called by zone->lock held in irq mode. > > This is not really nice because it blocks both any interrupts on that > > cpu and

Re: [RESEND PATCH v2] mm/oom_killer: Add task UID to info message on an oom kill

2019-09-20 Thread Rafael Aquini
> > I'll add this to the chagnelog: > > : We already print uid when dumping eligible tasks so it is not overly hard > : to find that information in the oom report. However this information is > : unavailable then dumping of eligible tasks is disabled. Thanks Andrew! just a minor nit there: 's/then/when/' Acked-by: Rafael Aquini >

Re: [RESEND PATCH v2] mm/oom_killer: Add task UID to info message on an oom kill

2019-06-12 Thread Rafael Aquini
mm, MM_ANONPAGES)), > K(get_mm_counter(victim->mm, MM_FILEPAGES)), > - K(get_mm_counter(victim->mm, MM_SHMEMPAGES))); > + K(get_mm_counter(victim->mm, MM_SHMEMPAGES)), > + from_kuid(_user_ns, task_uid(victim))); > task_unlock(victim); > > /* > -- > 2.18.1 > Acked-by: Rafael Aquini

Re: [PATCH v3] fs/proc: add VmTaskSize field to /proc/$$/status

2019-05-08 Thread Rafael Aquini
On Tue, May 07, 2019 at 11:37:16PM -0700, Yury Norov wrote: > On Tue, May 07, 2019 at 08:54:31AM -0400, Rafael Aquini wrote: > > On Mon, May 06, 2019 at 11:53:43AM -0400, Joel Savitz wrote: > > > There is currently no easy and architecture-independent way to find the > > &

Re: [PATCH v3] fs/proc: add VmTaskSize field to /proc/$$/status

2019-05-07 Thread Rafael Aquini
ut_decimal_ull_width(m, > + " kB\nVmTaskSize:\t", mm->task_size >> 10, 8); > seq_puts(m, " kB\n"); > hugetlb_report_usage(m, mm); > } > -- > 2.18.1 > Acked-by: Rafael Aquini

Re: [PATCH v3 1/2] kernel/sys: add PR_GET_TASK_SIZE option to prctl(2)

2019-05-03 Thread Rafael Aquini
On Fri, May 03, 2019 at 02:08:31PM -0700, Yury Norov wrote: > On Fri, May 03, 2019 at 02:10:20PM -0400, Joel Savitz wrote: > > When PR_GET_TASK_SIZE is passed to prctl, the kernel will attempt to > > copy the value of TASK_SIZE to the userspace address in arg2. > > > > It is important that we

Re: [PATCH v3 0/2] sys/prctl: expose TASK_SIZE value to userspace

2019-05-03 Thread Rafael Aquini
On Fri, May 03, 2019 at 01:49:12PM -0700, Yury Norov wrote: > On Fri, May 03, 2019 at 02:10:19PM -0400, Joel Savitz wrote: > > In the mainline kernel, there is no quick mechanism to get the virtual > > memory size of the current process from userspace. > > > > Despite the current state of

Re: [PATCH v3 1/2] kernel/sys: add PR_GET_TASK_SIZE option to prctl(2)

2019-05-03 Thread Rafael Aquini
On Fri, May 03, 2019 at 02:08:31PM -0700, Yury Norov wrote: > On Fri, May 03, 2019 at 02:10:20PM -0400, Joel Savitz wrote: > > When PR_GET_TASK_SIZE is passed to prctl, the kernel will attempt to > > copy the value of TASK_SIZE to the userspace address in arg2. > > > > It is important that we

Re: [PATCH v2 2/2] prctl.2: Document the new PR_GET_TASK_SIZE option

2019-05-02 Thread Rafael Aquini
On Thu, May 02, 2019 at 03:23:12PM -0700, Yury Norov wrote: > чт, 2 мая 2019 г. в 13:52, Joel Savitz : > > > > Add a short explanation of the new PR_GET_TASK_SIZE option for the benefit > > of future generations. > > > > Signed-off-by: Joel Savitz > > --- > > man2/prctl.2 | 9 + > > 1

Re: [PATCH v2 0/2] sys/prctl: expose TASK_SIZE value to userspace

2019-05-02 Thread Rafael Aquini
+++ > 1 file changed, 9 insertions(+) > > -- > 2.18.1 > If you decide to repost patch 1/2 to sort out the minor nit I pointed out, you can keep my ack. Acked-by: Rafael Aquini

Re: [PATCH v2 1/2] kernel/sys: add PR_GET_TASK_SIZE option to prctl(2)

2019-05-02 Thread Rafael Aquini
On Thu, May 02, 2019 at 04:52:21PM -0400, Joel Savitz wrote: > When PR_GET_TASK_SIZE is passed to prctl, the kernel will attempt to > copy the value of TASK_SIZE to the userspace address in arg2. > > Suggested-by: Alexey Dobriyan > Signed-off-by: Joel Savitz > --- > include/uapi/linux/prctl.h

Re: [PATCH v2] fs/proc: add VmTaskSize field to /proc/$$/status

2019-04-26 Thread Rafael Aquini
gt; 10, 8); > SEQ_PUT_DEC(" kB\nVmSwap:\t", swap); > - seq_puts(m, " kB\n"); > + SEQ_PUT_DEC(" kB\nVmSwap:\t", swap); > + seq_put_decimal_ull_width(m, > + " kB\nVmTaskSize:\t", TASK_SIZE >> 10, 8); > + seq_puts(m, " kB\n"); > hugetlb_report_usage(m, mm); > } > #undef SEQ_PUT_DEC > -- > 2.18.1 > Acked-by: Rafael Aquini

Re: [PATCH v2] mm/oom_killer: Add task UID to info message on an oom kill

2019-04-26 Thread Rafael Aquini
K(get_mm_counter(victim->mm, MM_FILEPAGES)), > - K(get_mm_counter(victim->mm, MM_SHMEMPAGES))); > + K(get_mm_counter(victim->mm, MM_SHMEMPAGES)), > + from_kuid(_user_ns, task_uid(victim))); > task_unlock(victim); > > /* > -- > 2.18.1 > Acked-by: Rafael Aquini

Re: [PATCH] fs/proc: add VmTaskSize field to /proc/$$/status

2019-04-25 Thread Rafael Aquini
> + " kB\nVmTaskSize:\t", TASK_SIZE >> 10, 8); > + seq_puts(m, " kB\n"); > hugetlb_report_usage(m, mm); > } > #undef SEQ_PUT_DEC > -- > 2.18.1 > Acked-by: Rafael Aquini

Re: [PATCH] mm/oom_killer: Add task UID to info message on an oom kill

2019-04-25 Thread Rafael Aquini
et_mm_counter(victim->mm, MM_ANONPAGES)), > K(get_mm_counter(victim->mm, MM_FILEPAGES)), > K(get_mm_counter(victim->mm, MM_SHMEMPAGES))); > -- > 2.18.1 > Acked-by: Rafael Aquini

Re: [PATCH v1] mm: balloon: drop unused function stubs

2019-04-02 Thread Rafael Aquini
} > - > -static inline bool isolated_balloon_page(struct page *page) > -{ > - return false; > -} > - > static inline bool balloon_page_isolate(struct page *page) > { > return false; > -- > 2.17.2 > Acked-by: Rafael Aquini

Re: [PATCH] mm: mempolicy: make mbind() return -EIO when MPOL_MF_STRICT is specified

2019-03-20 Thread Rafael Aquini
/* > + * Need check MPOL_MF_STRICT to return -EIO if possible > + * regardless of vma_migratable > + */ > + if (!vma_migratable(vma) && > + !(flags & MPOL_MF_STRICT)) > return 1; > > if (endvma > end) > @@ -622,7 +648,7 @@ static int queue_pages_test_walk(unsigned long start, > unsigned long end, > } > > /* queue pages from current vma */ > - if (flags & (MPOL_MF_MOVE | MPOL_MF_MOVE_ALL)) > + if (flags & MPOL_MF_VALID) > return 0; > return 1; > } > -- > 1.8.3.1 > Acked-by: Rafael Aquini

Re: [PATCH v3] mm/memory.c: do_fault: avoid usage of stale vm_area_struct

2019-03-03 Thread Rafael Aquini
*/ > static vm_fault_t do_fault(struct vm_fault *vmf) > { > struct vm_area_struct *vma = vmf->vma; > + struct mm_struct *vm_mm = vma->vm_mm; > vm_fault_t ret; > > /* > @@ -3561,7 +3564,7 @@ static vm_fault_t do_fault(struct vm_fault *vmf) > > /* preallocated pagetable is unused: free it */ > if (vmf->prealloc_pte) { > - pte_free(vma->vm_mm, vmf->prealloc_pte); > + pte_free(vm_mm, vmf->prealloc_pte); > vmf->prealloc_pte = NULL; > } > return ret; > -- > 1.8.3.1 > Acked-by: Rafael Aquini

Re: [PATCH RFC] mm: migrate: don't rely on PageMovable() of newpage after unlocking it

2019-01-28 Thread Rafael Aquini
On Mon, Jan 28, 2019 at 10:01:56AM -0500, Rafael Aquini wrote: > On Mon, Jan 28, 2019 at 03:38:38PM +0100, David Hildenbrand wrote: > > On 28.01.19 14:35, Michal Hocko wrote: > > > On Mon 28-01-19 14:22:52, David Hildenbrand wrote: > > >> On 28.01.19 14:21, Michal Hoc

Re: [PATCH RFC] mm: migrate: don't rely on PageMovable() of newpage after unlocking it

2019-01-28 Thread Rafael Aquini
ter > >>> the page lock. > >>> > >> > >> I assume that is fine as is as the page is isolated? (yes, it will be > >> modified later when moving but we are interested in the original state) > > > > OK, I've missed that the page is indee

[PATCH v2] sysctl: clean up nr_pdflush_threads leftover

2018-11-29 Thread Rafael Aquini
nr_pdflush_threads has been long deprecated and removed, but a remnant of its glorious past is still around in CTL_VM names enum. This patch is a minor clean-up to that case. Reviewed-by: William Kucharski Signed-off-by: Rafael Aquini --- v2: - adjust typo "was;" for VM_UNUSE

[PATCH v2] sysctl: clean up nr_pdflush_threads leftover

2018-11-29 Thread Rafael Aquini
nr_pdflush_threads has been long deprecated and removed, but a remnant of its glorious past is still around in CTL_VM names enum. This patch is a minor clean-up to that case. Reviewed-by: William Kucharski Signed-off-by: Rafael Aquini --- v2: - adjust typo "was;" for VM_UNUSE

[PATCH] sysctl: clean up nr_pdflush_threads leftover

2018-11-28 Thread Rafael Aquini
nr_pdflush_threads has been long deprecated and removed, but a remnant of its glorious past is still around in CTL_VM names enum. This patch is a minor clean-up to that case. Signed-off-by: Rafael Aquini --- include/uapi/linux/sysctl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[PATCH] sysctl: clean up nr_pdflush_threads leftover

2018-11-28 Thread Rafael Aquini
nr_pdflush_threads has been long deprecated and removed, but a remnant of its glorious past is still around in CTL_VM names enum. This patch is a minor clean-up to that case. Signed-off-by: Rafael Aquini --- include/uapi/linux/sysctl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

Re: [PATCH] mm: be more informative in OOM task list

2018-07-04 Thread Rafael Aquini
of dump_tasks(), and having seen these values misinterpreted > on more than one occassion, I think this is a valuable addition. > > Could you also expand out the "pid" field to allow for seven digits > instead of five? I think everything else is aligned. > > Feel free to add > > Acked-by: David Rientjes > > to a v2. > Same here, for a v2: Acked-by: Rafael Aquini

  1   2   3   4   5   6   7   >