lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 8 Apr 2015 14:19:23 +0200
From:	Peter Zijlstra <peterz@...radead.org>
To:	Sukadev Bhattiprolu <sukadev@...ux.vnet.ibm.com>
Cc:	Paul Mackerras <paulus@...ba.org>,
	Arnaldo Carvalho de Melo <acme@...nel.org>,
	mingo@...hat.com, Michael Ellerman <mpe@...erman.id.au>,
	dev@...yps.com, linux-kernel@...r.kernel.org,
	linuxppc-dev@...ts.ozlabs.org
Subject: Re: [PATCH v2 1/5] perf: Add a flags parameter to pmu txn interfaces

On Tue, Apr 07, 2015 at 05:34:55PM -0700, Sukadev Bhattiprolu wrote:
> diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
> index 2b62198..4dc3d70 100644
> --- a/include/linux/perf_event.h
> +++ b/include/linux/perf_event.h
> @@ -240,20 +240,27 @@ struct pmu {
>  	 *
>  	 * Start the transaction, after this ->add() doesn't need to
>  	 * do schedulability tests.
> +	 *
> +	 * Optional.
>  	 */
> -	void (*start_txn)		(struct pmu *pmu); /* optional */
> +#define PERF_PMU_TXN_ADD  0x1		/* txn to add/schedule event on PMU */

Please do not interleave these flags in the structure. Maybe place it
near PERF_EVENT_TXN.

> +	void (*start_txn)		(struct pmu *pmu, int flags);
>  	/*
>  	 * If ->start_txn() disabled the ->add() schedulability test
>  	 * then ->commit_txn() is required to perform one. On success
>  	 * the transaction is closed. On error the transaction is kept
>  	 * open until ->cancel_txn() is called.
> +	 *
> +	 * Optional.
>  	 */
> -	int  (*commit_txn)		(struct pmu *pmu); /* optional */
> +	int  (*commit_txn)		(struct pmu *pmu, int flags);
>  	/*
>  	 * Will cancel the transaction, assumes ->del() is called
>  	 * for each successful ->add() during the transaction.
> +	 *
> +	 * Optional.
>  	 */
> -	void (*cancel_txn)		(struct pmu *pmu); /* optional */
> +	void (*cancel_txn)		(struct pmu *pmu, int flags);
>  
>  	/*
>  	 * Will return the value for perf_event_mmap_page::index for this event,

So (again), why also pass the flags to cancel/commit ?

The transaction state _has_ to already record it, otherwise it doesn't
know if add/read are part of one.

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ